EasyAdmin: Configure search fields
8 June 2026 (Updated 8 June 2026)
Update the configureCrud method to look something like this:
class ClientCrudController extends AbstractCrudController
#[\Override]
public function configureCrud(Crud $crud): Crud
{
return parent::configureCrud($crud)
->setEntityLabelInSingular('Client')
->setEntityLabelInPlural('Clients')
->setDefaultSort(['id' => 'DESC'])
->setSearchFields([
'id',
'token',
'company.name',
'firstName',
'lastName',
]);
}
}
By default, EasyAdmin will search all of the entity’s scalar fields which means it won’t search for associations like company.name from the above.