更新代码
This commit is contained in:
23
app/Models/Article.php
Normal file
23
app/Models/Article.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user