New in EasyAdmin 5.8. EasyAdmin could already filter on a property of a related entity, or of a Doctrine embedded object, with the dot notation. But you had to declare the type of each filter yourself. Since 5.8, it reads the Doctrine mapping of the target property and guesses its type, as it already did for the properties of the entity itself.
Before
public function configureFilters(Filters $filters): Filters { return $filters ->add(TextFilter::new('author.fullName')) ->add(TextFilter::new('author.address.country')); }
Since EasyAdmin 5.8
public function configureFilters(Filters $filters): Filters { return $filters // "author" is an association of the Book entity ->add('author.fullName') // "address" is an embedded object of the Author entity ->add('author.address.country'); }
The guessed type follows the column: a TextFilter for a string, a NumericFilter for a number, an EntityFilter for an association. Date filters set on a related property read this mapping too: on a date column, a DateTimeFilter offers a date input, and no longer a date and time input. Declaring the filter yourself is now only useful to pick another type or to set its options.
Your task
The back office of a medical practice lists its consultations with, for each one, the patient's name, country and birth date. Its filters still declare their type the old way, and the birth date has none.
In ConsultationCrudController, reduce the two existing filters to their property name, then add a filter on patient.birthDate the same way. The list must not change, and each filter must keep the label of its matching column.