Answer the question
In order to leave comments, you need to log in
Why doesn't mass assignment protection work everywhere?
Hello! I can’t understand what logic is used to protect against mass assignments in Laravel, the documentation doesn’t seem to say anything about this, or I don’t understand something.
Here are three examples:
Example 1:
Order::create([
'field' => 10,
'field2' => 15,
]);
Order::whereKey([1, 2])->update([
'field' => 10,
'field2' => 15,
]);
Order::find(1)->update([
'field' => 10,
'field2' => 15,
]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question