['github', 'google']]); $response = $this->get('auth/github/login'); // Either the controller handles the request or another middleware // intervenes — but the SocialLogin middleware itself should not 404. $this->assertNotEquals(404, $response->getStatusCode()); }); test('middleware throws when provider not in config', function () { config(['auth.social.providers' => ['github']]); // Build a real route so $request->route()->parameter('provider') resolves. Route::middleware(SocialLogin::class) ->get('/test-social/{provider}', fn ($provider) => 'ok'); $response = $this->get('/test-social/unknown'); $response->assertNotFound(); });