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

Error target class [web] doesn not exist #121

Open
Nethh opened this issue Apr 8, 2024 · 2 comments
Open

Error target class [web] doesn not exist #121

Nethh opened this issue Apr 8, 2024 · 2 comments

Comments

@Nethh
Copy link

Nethh commented Apr 8, 2024

First of all, thank you for this amazing repository. However, it seems I have an issue with the web middleware. Whenever I add the middleware, it causes this error: Target class [web] does not exist. as seen in the figure below. I've tried running php artisan optimize:clear and config:cache but the error still persists.

image

Before submitting this issue, I tried to register Laravel routes for better understanding. Below is the configuration I have:

  1. My RouteServiceProvider Class
public function boot()
  {
          $this->configureRateLimiting();
  
          $this->routes(function () {
              Route::middleware('api')
                  ->prefix('api')
                  ->group(base_path('routes/api.php'));
  
              Route::middleware('web')
                  ->group(base_path('routes/web.php'));
          });
 }
  1. My Http Kernel Class
protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

        'api' => [
            \Illuminate\Routing\Middleware\ThrottleRequests::class . ':api',
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],
};
  1. My Routes Files

image

These are the configurations I've set up so far. I might be overlooking something. Could you please assist in resolving the issue? Any help would be greatly appreciated.

@Nethh Nethh changed the title Error target class [web] Error target class [web] doesn not exist/ Apr 8, 2024
@Nethh Nethh changed the title Error target class [web] doesn not exist/ Error target class [web] doesn not exist Apr 8, 2024
@tcampbPPU
Copy link
Member

thanks for reporting an issue, I can take a look into this later today. I also plan to upgrade to Laravel 11 within the week, so stay tuned for that as well.

@Nethh
Copy link
Author

Nethh commented Apr 9, 2024

Thanks and wating for the good news 😄

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