Код: Выделить всё
// bootstrap/app.php
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Http\Request;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
return Application::configure(basePath: dirname(__DIR__))
...
->withExceptions(function (Exceptions $exceptions) {
$exceptions->render(function (AuthorizationException $e, Request $request) {
return redirect()
->route('dashboard')
->withErrors($e->getMessage());
});
...
})
...
->create();
[img]https://i.sstatic .net/9QdVvzKN.png[/img]
(на этом снимке экрана используется barryvdh/laravel-debugbar)
Подробнее здесь: https://stackoverflow.com/questions/786 ... ot-working