Support the ongoing development of Laravel.io →
Security Blade Forms
Last updated 2 years ago.
0

What what?

0

Why is this not safe? Are you relying on html only? Where is your validation then???

0

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

0

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.

Last updated 9 years ago.
0

Can't you just reject the field and form if the user supplies a value for the field and they aren't user 1 ?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

screenager screenager Joined 12 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.