Assuming you are using
Input::all()
Try changing it to
Input::except('password_confirmation')
Thank you for the response however it does not help me. I need to have there that confirmation because it is required by validation.
I don't want to be storing data in repo by setting every value. It is storing resource with
Model::create($data);
by design. It will be better from the maintenance point of view since then I will not be required to update it in changes of my schema.
The app itself is working fine but the test fails because of it.
This was you are vulnerable to mass assignment.
Assign the $fillable
property and you will be safe and that will also solve this problem of yours.
Thanks for the response, but that is not the problem. I have $fillable
property and it is working like it should be except during tests.
I had same issue. In my case it was caused by Eloquent::unguard() in database seeds. You need to call Eloquent::reguard() after seeding database.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community