model = new UserMoneyLog(); } public function add(Request $request): Response { $response = $this->initializeBackend($request); if ($response !== null) return $response; if ($request->method() === 'POST') { return $this->_add(); } $userId = $request->get('userId', $request->post('userId', 0)); $user = User::where('id', $userId)->find(); if (!$user) { return $this->error(__("The user can't find it")); } return $this->success('', ['user' => $user]); } }