From 7efb0af7031c4936bc9d2a5fffb4c191466b0e8c Mon Sep 17 00:00:00 2001 From: Chris Brown Date: Wed, 27 Nov 2024 16:21:28 -0500 Subject: [PATCH] Update docs link --- docs/advanced-usage/exceptions.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/advanced-usage/exceptions.md b/docs/advanced-usage/exceptions.md index 64f37425..23115910 100644 --- a/docs/advanced-usage/exceptions.md +++ b/docs/advanced-usage/exceptions.md @@ -3,14 +3,14 @@ title: Exceptions weight: 3 --- -If you need to override exceptions thrown by this package, you can simply use normal [Laravel practices for handling exceptions](https://laravel.com/docs/10.x/errors#rendering-exceptions). +If you need to override exceptions thrown by this package, you can simply use normal [Laravel practices for handling exceptions](https://laravel.com/docs/errors#rendering-exceptions). An example is shown below for your convenience, but nothing here is specific to this package other than the name of the exception. You can find all the exceptions added by this package in the code here: [https://github.com/spatie/laravel-permission/tree/main/src/Exceptions](https://github.com/spatie/laravel-permission/tree/main/src/Exceptions) -**app/Exceptions/Handler.php** +**Laravel 10: app/Exceptions/Handler.php** ```php public function register() @@ -24,11 +24,9 @@ public function register() } ``` -**If you are running Laravel v11** +**Laravel 11: bootstrap/app.php** ```php -// bootstrap/app.php - ->withExceptions(function (Exceptions $exceptions) { $exceptions->render(function (\Spatie\Permission\Exceptions\UnauthorizedException $e, $request) { return response()->json([