all(); $query = []; if(!empty($params['activity_id'])){ $query['activity_id'] = $params['activity_id']; } $query['api_name'] = $params['_url']; $query['params'] = json_encode($params); $userInfo = $request->session()->get('userInfo'); $query['admin'] = $userInfo['username']; $codes = json_decode($response->getContent(), true); $query['code'] = $codes['error']; $query['create_time'] = time(); ApiLogs::insert($query); return $response; } }