0

I am using laravel 5.2. I am aborting the user for 403 page with the abort(403, 'Unauthorized action.'); command. This will redirects to 403 page. And prints the Unauthorized action message. But if I use custom blade for 403 page means how to print Unauthorized action message which given inside the abort function. I have searched through internet, and Laravel error pages document also. But I can't find the solution. How to print Unauthorized action message in my custom template file.

1 Answer 1

4

In your view you can get your message by call {{ $exception->getMessage() }}

When you call abort function it creates new Exception(HttpException), and first parameter passes like code and second like message.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.