view()->composer(['errors.404'], function ($view) {
$title = 'some text';
$view->with('title', $title);
});
The title var is not defined in views/errors/404.blade.php
insert this code in AppServiceProvider->boot()
view()->composer(['errors.404'], function ($view) {
$title = [config('dc.site_domain')];
$title[] = trans('404.Ups something is missing.');
$view->with('title', $title);
});
try to print $title in /views/errors/404.blade.php
quick fix in AppExceptionsHandler.php render method
if ($exception instanceof NotFoundHttpException) {
return response()->view('errors.404', [], 404);
}
this will render the correct view with correct data injected
use errors::404
instead of errors.404
@themsaid useful comment ever!
Most helpful comment
use
errors::404
instead oferrors.404