29 lines
494 B
PHP
29 lines
494 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class News extends Model
|
|
{
|
|
use SoftDeletes;
|
|
protected $table = 'news';
|
|
|
|
protected $fillable = [
|
|
'title',
|
|
'slug',
|
|
'content',
|
|
'image',
|
|
'link',
|
|
'tag',
|
|
'category',
|
|
'views',
|
|
'author_id'
|
|
];
|
|
|
|
public function author(){
|
|
return $this->belongsTo(User::class, 'author_id', 'id');
|
|
}
|
|
}
|