Laravel doesn't find path for built in error page layouts such as @extends('errors::minimal')
(for neither of errors::minimal, errors::layout, errors::illustrated-layout
);
If I publish pages and have ordinary view path pointer it of course works. However I have done it in the past and find it very useful just to extend the vendor provided layout. If it is an intentional change for version ^6.0.0, then this, sadly, may be closed.
@extends('errors::minimal')
@section('title', $title ?? $message)
@section('code', 200)
@section('message', $message ?? $title)
return view('pages.simple')->withMessage('they are simple yet pretty');
Facade\Ignition\Exceptions\ViewException
No hint path defined for [errors].
thrown:This looks like an Ignition issue so you might want to open up an issue on their repo: https://github.com/facade/ignition
@driesvints unfortunately not. I deleted Ignition package and yet:
I believe the issue shall be reopened.
Here is repo for exact error: https://github.com/flexchar/laravel-error-blade-template
The "errors::" view namespace is only registered on throwing exceptions.
https://github.com/laravel/framework/blob/869f02783a49cd0e16c66c0d362d2e4ea371f4b6/src/Illuminate/Foundation/Exceptions/Handler.php#L382
In fact, you directly call view() helper, there are no exceptions, so it caused the error 'no hinted path defined'
Hey @xuanquynh, that's a great insight.
However I can see that this method/behaviour been there since at least v5.7. Therefore, if it has worked before shouldn't it do now?
shouldn't it do now?
I am not sure, it still depends on your opinion. But I think you should use customized Exceptions to render an error page.
To be clear it is NOT an error I am trying to display. Throughout the application I am working on, there are functions that executes and simply returns plain messages. I want to make use of built-in pretty error pages to display those messages.
I'm hoping that someone else could take a look on it. As unless it is indented to prevent using those layouts, this is unexpected shift in framework behavior. :)
I have no idea. You may register it manually inside a service provider of you project, I think.
I have the same error by doing this:
https://laravel.com/docs/6.x/errors#render-method
The handler controller:
public function render($request, Exception $exception)
{
if ($exception
instanceof
\Illuminate\Database\Eloquent\ModelNotFoundException) {
return response()->view('errors.nomodel', [], 500);
}
return parent::render($request, $exception);
}
The view:
@extends('errors::minimal')
@section('title', __('Not Found'))
@section('code', '500')
@section('message', __(' Not Found'))
Hey Guys,
I had the same issue today, what was solved by changing @extends('errors:minimal') to @extends('errors.minimal') in the view. So change the colon to dot. Hopefully it will help you!
@MattHowdy Add "$this->registerErrorViewPaths();" line to the very first of render method.
public function render($request, Exception $exception)
{
$this->registerErrorViewPaths();
// your logic here.
}
@taylorotwell I had the same issue today. I thanks @xuanquynh for the solution.
May be this should be commited in repository ? Perhaps do you have another idea about this ?
Most helpful comment
Hey Guys,
I had the same issue today, what was solved by changing @extends('errors:minimal') to @extends('errors.minimal') in the view. So change the colon to dot. Hopefully it will help you!