code: public function create(StoreUserRequest $request)
      {
          $data = $request->all();
  
          /** @var \Unite\UnisysApi\Models\User $object */
          $object = $this->repository->create($data);
          $object->roles()->sync( $request->get('roles_id') ?: [] );
  
          \Cache::tags('response')->flush();
  
          return $this->response->resource($object);
      }
docs: Create
  
  @param StoreUserRequest $request
  
  @return Resource|UserResource