registerPolicies(); Auth::viaRequest('token-via-query-parameter', static function (Request $request): ?User { /** @var TokenManager $tokenManager */ $tokenManager = app(TokenManager::class); $token = $request->get('api_token') ?: $request->get('t'); return $tokenManager->getUserFromPlainTextToken($token ?: ''); }); $this->setPasswordDefaultRules(); } private function setPasswordDefaultRules(): void { Password::defaults(fn (): Password => $this->app->isProduction() ? Password::min(10)->letters()->numbers()->symbols()->uncompromised() : Password::min(6)); } }