Add custom permission error handling

This commit is contained in:
DariusIII
2018-08-06 15:50:59 +02:00
parent 385a8d760f
commit c1a0c90ad9
4 changed files with 79 additions and 0 deletions
+3
View File
@@ -48,6 +48,9 @@ class Handler extends ExceptionHandler
*/
public function render($request, Exception $exception)
{
if ($exception instanceof \Spatie\Permission\Exceptions\UnauthorizedException) {
abort(401);
}
return parent::render($request, $exception);
}
}