27 lines
524 B
PHP
27 lines
524 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
abstract class Post extends TranslatableModel
|
|
{
|
|
protected $fillable = [
|
|
'title', 'content', 'excerpt', 'user_id', 'feature_image_id'
|
|
];
|
|
|
|
protected $translatableAttributes = [
|
|
'title', 'content', 'excerpt'
|
|
];
|
|
|
|
public function author()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
|
|
public function featureImage()
|
|
{
|
|
return $this->belongsTo(MediaFile::class, 'feature_image_id');
|
|
}
|
|
}
|