I have custom error pages e.g. resources/views/errors/404.blade.php everything is working just fine but the localization is not working for error pages. If I change website language the error pages still show in default language I tried in many way but its not working, Can anyone please help me make this work thanks in advance.
I try to make it work via exception handler but don’t know how to do that. I can apply language middleware is someone can tell me where is default routes for error pages.
3
Answers
thank you guys a little discussion with you guys fixed my problem I get the session's locale value in exception handler that worked for me I am answering it may be can help some one else. Below are the thing I did in App/Exception/Handler.php
also i moved
from web group to global group in kernal.php
Open app/exceptions/handler.php
find render function paste here
don’t for get import this trait
You can also redirect to other pages in
AppExceptionsHandler.php
. You can also assign usingApp::setLocale()
. Like this: