Fix 404 error due to routes mapping #34

Merged
Ghost merged 4 commits from development into master 2021-12-27 09:26:38 -05:00
Showing only changes of commit 072f9659de - Show all commits

View File

@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Validation\ValidationException;
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Throwable;
class Handler extends ExceptionHandler
@ -49,6 +50,9 @@ class Handler extends ExceptionHandler
*/
public function render($request, Throwable $exception)
{
if ($exception instanceof NotFoundHttpException) {
return redirect('/search');
}
return parent::render($request, $exception);
}
}