24 lines
463 B
PHP
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();
|
|
}
|
|
|
|
}
|