HovedprosjektWebApp/app/BlogPost.php
Alex Thomassen c7b6d17b93
Add user registration and login
Add blog posts table, model and form request
2020-03-03 13:32:40 +01:00

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');
}
}