mardi 20 septembre 2016

Can a Laravel Policy tell the user/caller why it has failed?

Laravel policies are formulated as can() statements that return true or false. However, if we are not allowed an action, we are never given a reason why (since the method can only return true or false). All we can tell the user is that they cannot perform this action - not why they cannot.

Is there an established way of making a Laravel policy inform the caller why it has failed?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire