I create a view and add it to the file app/Exception/Handler.php
of the following way:
public function render($request, Exception $e){
if ($this->isHttpException($e)){
return $this->renderHttpException($e);
}else if($e instanceof NotFoundHttpException){
return response()->view('errors.404', [], 404);
}else{
return parent::render($request, $e);
}
}
the View:
@extends('layouts.plantilla_general')
@section('content')
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Error</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-12 col-center">
<div class="panel panel-default">
<div class="panel-heading">
Error
</div>
<div class="panel-body">
<h1>Error 404</h1>
<h3>La dirección que usted indicó no se encuentra.</h3>
<h3>Por favor, verifique e intente de nuevo.</h3>
</div>
<div class="panel-footer">
</div>
</div>
<!-- /.panel -->
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
</div>
<!-- /#page-wrapper -->
@stop
That template that I use works correctly in all the other views and I call it the way.
In that view it does not work for me or I do not know why the following error:
3/3 ErrorException in f01ad76b252031da132b58646a0076e33be5b20b.php line 239: Trying to get property of non-object (View: D: \ My Documents \ Paul \ SIMante \ System \ SIMante \ resources \ views \ layouts \ template_general.blade.php) (View: D: \ My Documents \ Pablo \ SIMante \ System \ SIMante \ resources \ views \ layouts \ template_general.blade.php)
2/3 ErrorException in f01ad76b252031da132b58646a0076e33be5b20b.php line 239: Trying to get property of non-object (View: D: \ My Documents \ Paul \ SIMante \ System \ SIMante \ resources \ views \ layouts \ template_general.blade.php)
1/3 ErrorException in f01ad76b252031da132b58646a0076e33be5b20b.php line 239: Trying to get property of non-object