basePath() . '/config' . ($path ? '/' . $path : $path); } } if (! function_exists('public_path')) { /** * Get the path to the public folder. * * @param string $path * @return string */ function public_path($path = '') { return app()->basePath() . '/public' . ($path ? '/' . $path : $path); } } function http($url, $param, $method = 'post') { try { $client = new \GuzzleHttp\Client(); $response = $client->request($method, $url, $param); $result = json_decode($response->getBody()->getContents(), true); if ($result['status_code'] == 200) { return $result['data']; } else { return []; } } catch (\Exception $exception) { return []; } }