30 lines
439 B
PHP
30 lines
439 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class BlogPost extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
/**
|
|
* 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()
|
|
{
|
|
return $this->belongs('App\User');
|
|
}
|
|
}
|