public function update($id, UpdateUserRequest $request)
    {
        $user = $this->repository->findWithoutFail($id);

        if (empty($user)) {
            return $this->sendError('User not found');
        }

        $user = $this->repository->update($request->all(), $id);
        $user->load($request->getWith());

        return $this->sendResponse($user, 'User updated successfully.');
    }
public function update($id, UpdateUserRequest $request)
    {
        $user = $this->repository->findWithoutFail($id);

        if (empty($user)) {
            return $this->sendError('User not found');
        }

        $user = $this->repository->update($request->all(), $id);
        $user->load($request->getWith());

        return $this->sendResponse($user, 'User updated successfully.');
    }
public function update ( $ id , UpdateUserRequest $ request ) { $ user = $ this -> repository -> findWithoutFail ( $ id ) ; if ( empty ( $ user ) ) { return $ this -> sendError ( 'User not found' ) ; } $ user = $ this -> repository -> update ( $ request -> all ( ) , $ id ) ; $ user -> load ( $ request -> getWith ( ) ) ; return $ this -> sendResponse ( $ user , 'User updated successfully.' ) ; }
Update the specified User in storage.

@param  int $id
@param UpdateUserRequest $request

@return JsonResponse
Update the specified User in storage .