resourceClass = $resource; $this->resourceName = $resource::uriKey(); $this->manyToManyRelationship = $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 sortable($value = true) { // @todo: This is not sortable for now return $this; } public function resolveValueFromModel($model) { return null; } public function toJsonSerialize() { return array_merge( [ 'belongsToManyRelationship' => $this->manyToManyRelationship, 'listable' => true, 'perPage' => $this->perPage(), 'label' => forward_static_call([$this->resourceClass, 'label']), 'resourceName' => $this->resourceName, 'singularLabel' => $this->singularLabel, ], parent::toJsonSerialize() ); } }