Laravel 5 : MassAssignmentException in Model.php
You can all column fillable:
protected $guarded = array();
Add your model.
This might happen in case if you have used the wrongly imported the class. if you are using the User Model.
Wrong Import
// mostly IDE suggestion
use Illuminate\Foundation\Auth\User;
Correct Model Import
use App\User;
i have gone through this. might help someone.
For the Mass Assignment Exception: you should specify all the fields of the model that you want to be mass-assignable through create or update operations on the property $fillable
:
protected $fillable = ['name', 'mobile', 'email', 'address', 'created_at', 'updated_at'];
Besides, the field $table
should contain only the model's table name:
protected $table = 'your_table_name';