hamilton
1212
4
Eloquent

Add [title] to fillable property to allow mass assignment on [App\Post].

Posted 9 months ago by hamilton

Hi Folks,

I'm new to Laravel (5.7) and trying to save to DB using Post::create()

Despite having:

protected $fillable = ['title','content'];

in the Post model when I attempt to run:

Post::create([
'title' => 'Post Title',
    'content' => 'Post Content' 
]);

I get:

"Add [title] to fillable property to allow mass assignment on [App\Post]."

I searched everywhere for solution but come up with nothing so for.

Any help appreciated. If more info required let me know.

Thanks

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.