Why is this not safe? Are you relying on html only? Where is your validation then???
You should always validate all input server side - so when the form is submitted you need to check that the user has the id of 1 before this has any influence
Hold on, this is not a question on validation of forms.
Because of course there is validation, but i'm trying to re-use my forms for several types of users. I was looking for a more generic way on protecting some fields of a model depending on the permissions of user.
Anyway, playing with the guarded property of a model and accessing this information in my blade form works out.
Can't you just reject the field and form if the user supplies a value for the field and they aren't user 1 ?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community