In Laravel, when you make model you need to add "fillable" or "guarded" to store/update records. The columns that are set in "$fillable" are supposed to be mass assigned.

//BookModel.php ... use Illuminate\Database\Eloquent\Model; class Book extends Model { protected $fillable=[ 'title','author' ]; }

If you forget to add "$fillable" or "$guarded", you will get an error as below.

('autor' should be 'author') in "$fillable", for example, protected $fillable=[ 'title','autor' ]; you will get an error, of course.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners