In Laravel 5, App::missing
and App::error
is not available, so how do your catch exceptions and missing pages now?
I could not find any inf
Since commits 30681dc and 9acf685 the missing()
method had been moved to the Illuminate\Exception\Handler
class.
So, for some time, you could do this:
app('exception')->missing(function($exception)
{
return Response::view('errors.missing', [], 404);
});
... But then recently, a refactoring has been done in 62ae860.
Now, what you can do is adding the following to app/Http/Kernel.php
:
// add this...
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Response;
class Kernel extends HttpKernel {
(...)
public function handle($request)
{
try
{
return parent::handle($request);
}
// ... and this:
catch (NotFoundHttpException $e)
{
return Response::view('errors.missing', [], 404);
}
catch (Exception $e)
{
throw $e;
}
}
Finally, please keep in mind Laravel is still under heavy development, and changes may occur again.