I am using EasyAdmin 4.6 for a project and I have a CollectionField that display Needs entities nested to the Edit CRUD of another entity called JoinUs :

The thing is, my Collection field is displaying my entities but I can't find a way to change the accordion title (bottom of the picture above).
Here is my configureFields method in JoinUsCrudController.php :
    public function configureFields(string $pageName): iterable
    {
        yield TextField::new('name')->setLabel('Nom de la page');
        yield TextareaField::new('content')->setLabel('Contenu de la page')
                                    ->setFormType(CKEditorType::class)
                                    ->setFormTypeOptions(
                                        [
                                            'config_name' => 'custom_style',
                                            'attr' => ['rows' => '20', 'class' => 'w-100'] ,
                                        ])
                                    ->addCssClass('field-ck-editor');
        yield CollectionField::new('needs', 'Besoins')
            ->setEntryIsComplex(true)
            ->setEntryType(NeedsType::class)
            ->setColumns(12)
            ->allowAdd(true)
            ->allowDelete(true)
            ->setFormTypeOption('by_reference', false);
    }
Where can I change the accordion value displayed ?
I've read the documentation of EasyAdmin and it doesn't seem to be there
You need to create the __toString(){} method of the Need entity
<?php 
// ...
class Need {
// ...
    public function __toString() {
        return $this->name;
    }
}
// ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With