- added not found exception for Model

- cleared dev console
- get share record refactored on backend
This commit is contained in:
Peter Papp
2021-03-17 12:24:15 +01:00
parent 1d52186f17
commit fc18280842
16 changed files with 211 additions and 353 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Exceptions;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
@@ -50,6 +51,12 @@ class Handler extends ExceptionHandler
*/
public function render($request, Throwable $exception)
{
if ($exception instanceof ModelNotFoundException) {
return response()
->redirectTo('/not-found')->setStatusCode(404);
}
return parent::render($request, $exception);
}
}