Saturday, March 18, 2017

Custom error page not working in Laravel 5.3

I have the following file in views/errors/404.blade.php:

Error Here!

That works as expected when I enter an incorrect URL (I see just the "Error Here!" text).

However, if I update the file to include the following:

@extends('layouts.page')

@section('title', @trans('general.error'))

@section('content')

    Error here!

@endsection

I do get the "Error here" message, but I'm also seeing the "Whoops, looks like something went wrong." message and the HTML is all messed up. The specified layout (layouts/page.blade.php) exists and is what I used for all other views.

Any idea why this is happening?

Thanks in advance!



via zundi

Advertisement