log_admin_id = $logAdminId; $model->log_name = $name; $model->log_route = \request() && \request()->uri() ? \request()->uri() : (\request() && \request()->route && \request()->route->getPath() ? \request()->route->getPath() : ''); $model->log_operation = $operation; $model->log_ip = \request() && \request()->getRealIp() ? \request()->getRealIp() : '0.0.0.0'; $model->log_request_params = $requestParams ? json_encode($requestParams) : json_encode(\request()->all()); $model->log_operation_data = $operationData ? json_encode($operationData) : null; $model->save(); } } if (!function_exists('json_throw')) { function json_throw($code, $message, $data = '', $options = JSON_UNESCAPED_UNICODE) { $return = [ 'code' => $code, 'message' => $message, 'data' => $data, ]; return new \support\Response(200, ['Content-Type' => 'application/json'], json_encode($return, $options)); } }