2020-03-03 13:32:40 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2020-03-09 14:03:08 +01:00
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
2020-03-03 13:32:40 +01:00
|
|
|
|
|
|
|
class BlogPost extends Model
|
|
|
|
{
|
2020-03-09 14:03:08 +01:00
|
|
|
use SoftDeletes;
|
2020-03-03 13:32:40 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The attributes that are mass assignable.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $fillable = [
|
|
|
|
'title', 'body',
|
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the creator of the blog post.
|
|
|
|
*
|
|
|
|
* @return App\User
|
|
|
|
*/
|
|
|
|
public function user()
|
|
|
|
{
|
2020-03-09 14:03:08 +01:00
|
|
|
return $this->belongsTo('App\User');
|
2020-03-03 13:32:40 +01:00
|
|
|
}
|
|
|
|
}
|