Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Easyadmin Plus Bundle Laravel Package

2lenet/easyadmin-plus-bundle

View on GitHub
Deep Wiki
Context7

Batch actions

Batch actions are actions triggered on a set of selected objects.

Settings

To enable batch actions, you've to add a new node (batchs) for the action list of the entity.

# config/packages/easy_admin.yaml
easy_admin:
    entities:
        Controle:
            class: App\Entity\Controle
            disabled_actions: ['new']
            role: ROLE_CONTROLE
            list:
                title: title.echeance.list
                batchs:
                    - { name: delete, icon: trash, label: label.delete, service: lle.service.delete_batch }
                    - { name: clos, icon: check, label: label.valider, service: App\Service\Batch\ControleCloreBatch, role: 'ROLE_ADMIN' }
                actions:
                    - { name: show, icon: search }
                    - { name: edit, icon: edit }
                    - { name: delete, icon: trash }

On the list, checkbox inputs are added toselect items and buttons are visible on bottom of the list.

Exemple BatchAction

<?php
class DeleteBatch implements BatchInterface
{
    private $count = 0;

    public function execute($request, array $entityConfig, $ids, array $data) 
    {
        foreach ($ids as $itemId) {
            $count++;
        }
    }
    
    public function countSuccess(){
        return $this->count;
    }


}

Default behavior

Button are enable only if items are selected


Role

By default, batch action will be only accessible to users with role defined like this ROLE_[ENTITY_NAME]BATCH[BATCH_NAME] You can disable this with the param

role: null

or define your role permission

role: ROLE_ADMIN

Back to main readme

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui