xxxxxxxxxx
//Laravel provides by default a protection against mass assignment security issues.
//That's why you have to manually define which fields could be "mass assigned" :
class User extends Model
{
protected $fillable = ['username', 'email', 'password'];
}
xxxxxxxxxx
Example:
If u are trying to use the method create in php artisan tinker :
\App\<class_name>:create
You will notice the error :
Illuminate\Database\Eloquent\MassAssignmentException with message
The reason is going to your class and add: protected $fillable
class <class_name> extends Model
{
protected $fillable = ['<column_name>' , '<column_name>', '<column_name'];
}