code: public function apiResource(string $entityName, ?string $name = null, ?string $id = null): ResourceCollection
      {
          return $this->resource($entityName, $name, $id)->only([
              'index', 'store', 'show', 'update', 'destroy'
          ]);
      }
docs: @param string $entityName
  @param null|string $name
  @param null|string $id
  
  @return ResourceCollection