resourceClass = $resource; $this->resourceName = $resource::uriKey(); $this->hasManyRelationship = $this->attribute; $this->singularLabel = $name; $this->showOnIndex = false; $this->showOnCreation = false; $this->showOnUpdate = false; } public function perPage() { $resourceClass = $this->resourceClass; return $resourceClass::$perPageViaRelationship; } public function resolveValueFromModel($model) { return null; } public function toJsonSerialize() { return array_merge( [ 'hasManyRelationship' => $this->hasManyRelationship, 'listable' => true, 'perPage' => $this->perPage(), 'resourceName' => $this->resourceName, 'singularLabel' => $this->singularLabel ], parent::toJsonSerialize() ); } }