Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9 test #619

Open
MambetniyazovAmir opened this issue Aug 3, 2022 · 1 comment
Open

9 test #619

MambetniyazovAmir opened this issue Aug 3, 2022 · 1 comment

Comments

@MambetniyazovAmir
Copy link

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 () {
..................
}

@tibix
Copy link

tibix commented Mar 12, 2024

That is not the correct way to have prefix and middleware.
You need to use Route::group(['prefix'=>'admin', 'middleware'...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants