Open rummykhan opened 3 years ago
I never heard of an attack that solely benefited from knowing that some property of a user was named password
, is_admin
, app_secret
or whichever. The issue would be that the hacker was able to change those properties, not that he knew what the property was called.
Also, the transform example you are showing is only giving synonyms to your properties which does not help much anyway in hiding the true name of the property. I personally wouldn't bother with building such feature.
Hi @rummykhan
You can use $request->validated()
instead of $request->all()
to only fill attributes that you validated in your request class and ignore any other request inputs that the user sends to application including your important database fields.
Hi everybody,
I've worked on multiple laravel projects and for some simple forms we usually do something like this
Model
Blade:
Controller
Benefit of this approach is
Problem with this approach is
Idea Proposal / Idea is to add
public function transform()
in theFormRequest
where we can transform these parameters in theFormRequest
and still able to enjoy the laravely way.