EasyAdmin 5.8 is out with redesigned badges and automatic filter types for nested properties. But first, a fun fact: this is the 400th release of EasyAdmin since we started the project in 2015. Thanks to everyone who used, tested, reported and contributed during all these years!
Redesigned Badges
Badges are everywhere in EasyAdmin backends: boolean values, statuses, tags, languages, etc. In EasyAdmin 5.8 they have a completely new design. They still look familiar, but they look much better in your backends:
Click to see a higher resolution image and a before/after comparison
The <twig:ea:Badge> component now separates the style of the badge from its color:
- The
variantprop sets the style:light(the default),solid,outlineordot. The defaultlightstyle is now lighter than before and includes a thin border. - The new
colorprop sets the color (success,danger,warning, etc.). You can also use the newBadgeColorenum for this.
<twig:ea:Badge color="success">Paid</twig:ea:Badge>
<twig:ea:Badge variant="solid" color="danger">Overdue</twig:ea:Badge>
<twig:ea:Badge variant="dot" color="warning">Pending</twig:ea:Badge>
If you prefer a different style, you don't have to change your templates. Call the new setBadgeVariant() method in your dashboard to change all the badges of the backend, or in a CRUD controller to change only the badges of that controller:
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
class DashboardController extends AbstractDashboardController
{
// ...
public function configureCrud(): Crud
{
return Crud::new()
// possible values: 'light' (default), 'solid', 'outline', 'dot'
->setBadgeVariant('solid');
}
}
A badge that sets its own variant prop keeps it, so you can still use a different style in a specific place.
There are some other improvements too:
- The new
dismissibleprop adds a dismiss button to the badge; - Icons, images (such as user avatars) and the
Flagcomponent now fit nicely inside badges; - The
lgsize of badges now works as expected.
Note: Before, you defined the color of badges with the
variantprop (e.g.<twig:ea:Badge variant="success">). This still works, but it's deprecated. Usecolor="success"instead. If you customized the badge CSS variables, check the UPGRADE guide because some of them changed.
Filter Type Guessing for Nested Properties
EasyAdmin already supported filters on the properties of associated entities and Doctrine embeddables using the dot syntax (author.fullName). However, you had to create the filter yourself, because EasyAdmin only guessed the filter type of the properties of the entity itself.
Before, you had to write this:
public function configureFilters(Filters $filters): Filters
{
return $filters
->add(TextFilter::new('author.fullName'))
->add(TextFilter::new('author.address.country'));
}
Now, EasyAdmin reads the Doctrine mapping of the nested property and guesses the filter type, exactly like it does for regular properties:
public function configureFilters(Filters $filters): Filters
{
return $filters
// 'author' is an association of the Book entity
->add('author.fullName')
// 'address' is a Doctrine embeddable inside the Author entity
->add('author.address.country');
}
You only need to create the filter explicitly when you want to use a different filter or customize its options.
In addition, the date, numeric, text and comparison filters now read the mapping of the nested property too. For example, if birthDate is a date column, DateTimeFilter::new('author.birthDate') now displays a date widget instead of a datetime one.
Behind the Scenes: a New Test Suite
This change doesn't affect your applications at all, but it's a big change for the project: we completely revamped the EasyAdmin test suite.
-
Plain PHPUnit 11: we stopped using
simple-phpunitand the PHPUnit bridge. We were stuck on PHPUnit 9.6 and now we use PHPUnit 11 directly. - Foundry for fixtures: before, tests used big generic Doctrine Fixtures shared by all tests. Now, every test starts with empty tables and creates only the data it needs using Foundry factories. Combined with DAMA DoctrineTestBundle, which rolls back the database after each test.
-
Multiple databases: the functional tests used to run only on SQLite. Now they also run on PostgreSQL, MySQL and MariaDB in our CI. This already paid off: it found two bugs in
ArrayFilterthat are fixed in this release.
If you write tests for your Symfony applications, I recommend you to try Foundry. Your tests will be much easier to read and maintain, because each test clearly shows the data it needs.
Support EasyAdmin development:
⭐ Upgrade to EasyAdmin Pro for advanced features like Audit Log and Content Lock
❤️ Become a sponsor if EasyAdmin helps your company ship faster

Top comments (2)
test suite updates look awesome!
Thanks! I love Foundry (and Doctrine Test Bundle). I use it in all my work applications, so I wanted to also use it here ... and we finally could do it.