9 months ago

Getting 500 error codes instead of 404 when edited the exception handler file.

Posted 9 months ago by gouseferoz

Hi All,

In the exceptions\handler.php code, I have changed the render function to this:

public function render($request, Exception $exception)
        $guard = array_get($exception->guards(), 0);

            case 'admin':
                return redirect('/admin/login');
                return redirect('/login');
        return parent::render($request, $exception);

which is causing the server to show 500 error instead of 404 error for the pages that were not routed in web.php file.

What should be done here to get the actual 404 errors instead of 500

Regards, Feroz

Please sign in or create an account to participate in this conversation.