Answer the question
In order to leave comments, you need to log in
Laravel policies and data transfer?
how to get out of such situations: the id of something is passed and you need to get, check and return the authentication result, and then work with this data in the controller. In general, I used the policy to check, but now I need this data a little lower under checking the result of the policy through
so, remove the policy altogether and put the check in the controller? Gate::denies('add', ...) {}
Answer the question
In order to leave comments, you need to log in
Well, you pull the entity by ID to the gate, then feed this entity to the gate, then work with it. Why remove politics?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question