Config('liman_mobile'); $password = $config->Config('liman_password'); $liman = Http::timeout(10)->post('http://212.23.201.173/server/auth/login', [ 'mobile' => $mobile, 'password' => $password, 'provider' => 'customer', 'type_app' => 'client', ])->json(); $token = $liman['access_token'] ?? $liman['token'] ?? null; if (!$token) { throw new \Exception('Liman login failed: ' . json_encode($liman, JSON_UNESCAPED_UNICODE)); } $config->UpdateConfig('liman_token', $token); return $token; } }