Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function update($id, ClientUserUpdateRequest $request)
- {
- $repository = new ClientUserRepository();
- $toSend = $request->all();
- $user = $repository->findByLocalId($id, \Auth::id());
- $toSend['client_id'] = \Auth::id();
- $toSend['local_id'] = $id;
- if (isset($toSend['password'])) {
- $toSend['password'] = \Hash::make($toSend['password']);
- }
- if (is_null($user)) {
- return $this->formatResponse($repository->create($toSend));
- }
- return $this->formatResponse($repository->update($user->id, $toSend));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement