You throw the error and redirect to a friendly page to display the error. See https://laravel.com/docs/7.x/errors
May 13, 2020
4
Level 14
How to get error message if user is not authorized in request
Hi
It is very useful to create a Request for validating input from a form.
One then need to implement the rule() and for errror mesages the message() merhod.
Let’s say that the authorized() return false, then the code in the method of the request is not executed.
How about getting error messages if the user is not authorized to perform the request?
Please or to participate in this conversation.