chinleung / laravel-multilingual-routes

A package to handle multilingual routes in your Laravel application.
https://github.com/chinleung/laravel-multilingual-routes-demo
MIT License
394 stars 26 forks source link

Customize 404 and 500 error pages #48

Closed climascomunicacion closed 3 years ago

climascomunicacion commented 3 years ago

I try to customize error pages for the 404 and 500 error using Laravel 8.x , but i don't know how to handel these errors with multilingual-routes.

I have 2 baldes in /resources/views/errors/404.blade.php and /resources/views/errors/500.blade.php

I edited /app/Exceptions/Handler.php:

Captura de pantalla 2021-03-19 a las 13 39 59

But when i type a no existing url (http://localhost/sdfsdfsdfsd) i keep seeing the standard error message and not my customized error page:

Captura de pantalla 2021-03-19 a las 13 31 57

chinleung commented 3 years ago

@climascomunicacion I don't think this has anything to do with the package but I can help you debug it.

What is the error 500? You can find it in your storage/logs.

Also, you don't need the if case in your Handler.php since Laravel will handle it for you automatically.

https://laravel.com/docs/8.x/errors#custom-http-error-pages

climascomunicacion commented 3 years ago

Thanks for the replay,

debuging the error i found a bad route in one of my blades in the layout i was using to show the custom 404 error page.

I fixed that route and deleted the render function i was using in Handler.php.

Now it's working fine