Just an added not about this. Just read:
Guarded checks if the field is guarded or not. If the field is not in the guarded array it assumes its ok and assign the value which can cause errors if the field does not exists.
Fillable is checked first so if the field is in the fillable array it will assign the value, if not just silently fail it.
So fillable is much less prone to errors caused by the form trying to insert data into a field that does not exist. As a rule just set both guarded and fillable!
Gav.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community