quyle92 liked this thread
$hidden
is something completely different from $fillable
and $guarded
which are opposites. $fillable
describes which fields can be mass assigned(via fill()
method for example) while $guarded
sets which fields can not be mass assigned so when you fill()
with properties that are guarded they won't get saved in database. $hidden
are fields that won't be shown when serializing model to JSON or array.
Regarding your questions
password, user_role, user_points
$guardedlonerunner said: And/Or same input fields can't be set in both fillable and guarder or hidden and fillable. I guess guarded and hidden doesn't make sense?
Putting same field in guarded and fillable does not make sense. Mixing guarded or fillable with hidden does.
quyle92 liked this reply
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community