I have started a project with laravel which has userInfo model.
As I am trying to insert or update it shows me below error message in Laravel.
Is there any issue with PHP version or with laravel model?
MassAssignmentExcept ion in model.php
Error Message:
MassAssignmentExcept ion in model.php
It can occur due to two possibilities:
- For a mass assignment, need to provide all the fields of a model which will be mass assigned while during an update or create operation.
protected $fillable = ['age', 'phone', 'mail', 'location', 'created_at', 'updated_at'];
- Table name should be assigned in $table = “user_info” in model file