0
0
Files
Babyclass/app/Models/Article.php
2020-08-04 10:09:42 +08:00

24 lines
463 B
PHP

<?php
namespace App\Models;
use App\Contracts\Advertable;
use Illuminate\Database\Eloquent\Model;
use RuLong\Panel\Models\Storage;
class Article extends Model implements Advertable
{
protected $fillable = ['title','description','content','storage_id','type'];
public function link()
{
return route('articles.show', $this);
}
public function storage()
{
return $this->belongsTo(Storage::class)->withDefault();
}
}