code: public function create(StoreInterface $store, CreateResource $request)
      {
          $record = $this->transaction(function () use ($store, $request) {
              return $this->doCreate($store, $request);
          });
  
          if ($this->isResponse($record)) {
              return $record;
          }
  
          return $this->reply()->created($record);
      }
docs: Create resource action.
  
  @param StoreInterface $store
  @param CreateResource $request
  @return Response