public function setPreference(Request $request) { $this->validate($request, ['preference' => 'required|preference']); $this->player->setPreference($request->preference); return json(trans('user.player.preference.success', ['name' => $this->player->player_name, 'preference' => $request->preference]), 0); }