1) Tests\Feature\RoutesTest::test_is_admin_middleware_is_working
Expected response status code [201, 301, 302, 303, 307, 308] but received 500.
The following exception occurred during the request:
ErrorException: Attempt to read property "is_admin" on null in /home/runner/work/Test-Laravel-Routes/Test-Laravel-Routes/app/Http/Middleware/IsAdminMiddleware.php:19
There was 1 failure:
1) Tests\Feature\RoutesTest::test_is_admin_middleware_is_working Expected response status code [201, 301, 302, 303, 307, 308] but received 500.
The following exception occurred during the request:
ErrorException: Attempt to read property "is_admin" on null in /home/runner/work/Test-Laravel-Routes/Test-Laravel-Routes/app/Http/Middleware/IsAdminMiddleware.php:19
Route::middleware('is_admin')->prefix('admin')->group(function () { .................. }