sectionStore = $sectionStore; $this->productCategoryStore = $productCategoryStore; } public function configureIndex(): array { $fieldArray = ($this->section == null) ? ['section'] : []; return array_merge($fieldArray, [ 'id', 'title', 'position', 'createdAt', 'updatedAt', 'status', 'saleStatus' ]); } public function configurePanels(): array { return [ 'main', 'seo', 'conf' ]; } public function configurePanelMain() { return [ 'section', 'title', 'parent', 'description', 'isEligibleTicketRestaurant', 'saleStatus', 'status', ]; } public function configureFields(): array { $productCategoryArray = $this->productCategoryStore ->setSection($this->section) ->getParents(); return [ 'title' => TextField::new('title')->setSortable(true), 'position' => NumberField::new('position')->setSortable(true), 'parent' => AssociationField::new('parent') ->setFormTypeOption('choices', $productCategoryArray), 'description' => CKEditorField::new('description'), 'saleStatus' => ToggleField::new('saleStatus')->setSortable(true), 'isEligibleTicketRestaurant' => ToggleField::new('isEligibleTicketRestaurant')->setSortable(true), ]; } }