Extensions for EasyAdmin: DTO-backed CRUD controllers, entity and JSON fields, an enum filter, menu item matchers, and PHPUnit test cases for dashboards and CRUD actions.
Require using composer:
$ composer require protung/easyadmin-plus-bundleSymfony Flex registers the bundle. Without Flex, add it to config/bundles.php:
return [
// ...
Protung\EasyAdminPlusBundle\ProtungEasyAdminPlusBundle::class => ['all' => true],
// ...
];Since EasyAdmin 5.7, a custom message passed to askConfirmation() is shown as body text and the modal's title is hidden, while the delete confirmation keeps a title and a description. To give another action's confirmation a title and a body like the delete one's, pass a ConfirmationModal:
use Protung\EasyAdminPlusBundle\Action\ConfirmationModal;
use function Symfony\Component\Translation\t;
Action::new('close')
->linkToCrudAction('close')
->askConfirmation(new ConfirmationModal(t('close.confirmation_modal.title'), t('close.confirmation_modal.content')));A label for the confirmation button can still be passed as askConfirmation()'s second argument. Before EasyAdmin 5.7, and for the delete action, the title and the body are shown joined as a single message. Batch actions keep EasyAdmin's batch confirmation.
Since EasyAdmin 5.10, askConfirmation() also takes a closure, which EasyAdmin calls for each entity. It can return a ConfirmationModal too, which is shown the same way:
Action::new('close')
->linkToCrudAction('close')
->askConfirmation(static fn (Order $order): ConfirmationModal|false => $order->isOpen()
? new ConfirmationModal(t('close.confirmation_modal.title'), t('close.confirmation_modal.content'))
: false);ActionsWalker::applyToAllActions($actions, $apply) calls $apply with every action of every page, and passes an action group as a whole, without opening it. Outside a controller, an ActionsExtensionInterface for example can use it. In a controller extending BaseCrudController, it is $this->applyToAllActions().
This package is licensed using the MIT License.
Please have a look at LICENSE.md.