user(); $workspace = $user?->currentWorkspace; return $workspace !== null && $user->can('manageTeam', $workspace); } /** * @return array */ public function rules(): array { return [ 'name' => ['required', 'string', 'max:255'], 'expires_at' => CreateApiKey::expiresAtRules(), ]; } }