src/Http/Controllers/UserController.php
public function update($id, UpdateUserRequest $request)
    {
        /** @var \Unite\UnisysApi\Models\User $object */
        if(!$object = $this->repository->find($id)) {
            abort(404);
        }

        $this->authorize('update', $object);

        $data = $request->all();

        $object->update($data);
        $object->roles()->sync( $request->get('roles_id') ?: [] );

        \Cache::tags('response')->flush();

        return $this->successJsonResponse();
    }
public function update($id, UpdateUserRequest $request)
    {
        /** @var \Unite\UnisysApi\Models\User $object */
        if(!$object = $this->repository->find($id)) {
            abort(404);
        }

        $this->authorize('update', $object);

        $data = $request->all();

        $object->update($data);
        $object->roles()->sync( $request->get('roles_id') ?: [] );

        \Cache::tags('response')->flush();

        return $this->successJsonResponse();
    }
public function update ( $ id , UpdateUserRequest $ request ) { /** @var \Unite\UnisysApi\Models\User $object */ if ( ! $ object = $ this -> repository -> find ( $ id ) ) { abort ( 404 ) ; } $ this -> authorize ( 'update' , $ object ) ; $ data = $ request -> all ( ) ; $ object -> update ( $ data ) ; $ object -> roles ( ) -> sync ( $ request -> get ( 'roles_id' ) ? : [ ] ) ; \ Cache :: tags ( 'response' ) -> flush ( ) ; return $ this -> successJsonResponse ( ) ; }
Update

@param $id
@param UpdateUserRequest $request

@return \Illuminate\Http\JsonResponse
Update