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

Posted 2 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.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.