Am following a tutorial attempting to learn how to use Laravel5.5. After following a step which said to add protected $fillable = array('email', 'password', 'name');
to the User model.
Which I'm assuming is setting which fields are mass assignable fields? The next step was to add:
User::create(array(
'email' => 'your@email.com',
'password' => Hash::make('password'),
'name' => 'John Doe'
));
Which I'm to understand is to add said user to the db.
When I run php artisan migrate
I receive [Illuminate\Database\Eloquent\MassAssignmentException] email
and I have no idea why. I have tried adding Eloquent::unguard()
, have tried to make it all guardable.
Have removed email from the fillable array. Have got rid of email altogther.
Each time I run php artisan migrate
the error is this same.
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2AxRZNy
via IFTTT
Aucun commentaire:
Enregistrer un commentaire