Skip to content

Error target class [web] doesn not exist #121

@Nethh

Description

@Nethh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions