manuxi / sulu-bulk-actions-bundle
Bulk Actions for Sulu bundles.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:JavaScript
Type:symfony-bundle
pkg:composer/manuxi/sulu-bulk-actions-bundle
Requires
- php: ^8.1
- doctrine/doctrine-bundle: ^2.13
- phpcr/phpcr-migrations-bundle: ^1.6
- sulu/sulu: ^2.5
- symfony/intl: ^6.2 | ^7.0
- symfony/translation: ^6.2 | ^7.0
Requires (Dev)
- jackalope/jackalope-doctrine-dbal: ^1.3.4
- phpspec/prophecy: ^1.17
- phpunit/phpunit: ^8.0
- symfony/browser-kit: ^4.4 | ^5.0 | ^6.2 | ^7.0
- symfony/console: ^4.4 | ^5.0 | ^6.2 | ^7.0
- symfony/phpunit-bridge: ^4.4 | ^5.0 | ^6.2 | ^7.0
This package is auto-updated.
Last update: 2025-10-26 12:25:05 UTC
README
I made this bundle to have the possibility to manage bulk actions in lists of my projects.
Please feel comfortable submitting feature requests. This bundle is still in development. Use at own risk 🤞🏻
👩🏻🏭 Installation
Some tasks are awaiting you!
Install the package with:
composer require manuxi/sulu-bulk-actions-bundle
Rebuild admin sources:
cd assets/admin
npm install
npm run build
- Then add the config for resourcekey and actions to Admin in project/bundle
public function getConfigKey(): ?string { return 'sulu_mybundle'; } public function getConfig(): ?array { return [ 'resourceKey' => 'mybundle', //with this, the route is build: /admin/api/{resourceKey}/bulk-{action} 'bulkActions' => [ 'publish' => ['icon' => 'su-eye'], 'unpublish' => ['icon' => 'su-eye-slash'], ], ]; }
- The action-buttons must be added to the Admin-Class in project/bundle
$listToolbarActions[] = new ToolbarAction('app.bulk.actions_dropdown', [ 'label' => 'sulu_bulk_actions.actions', 'icon' => 'su-pen', 'actions' => [ 'app.bulk.publish', 'app.bulk.unpublish', ], ]);
- Add a handler in project/bundle
class MybundleBulkActionHandler { public function __construct( private readonly MybundleModel $model, ) { } public function supports(string $resourceKey, string $action): bool { return 'testimonials' === $resourceKey && in_array($action, ['publish', 'unpublish']); } public function handle(string $action, array $ids, Request $request): array { return match ($action) { 'publish' => $this->tmodel->publishBulk($ids, $request), 'unpublish' => $this->model->unpublishBulk($ids, $request), default => [], }; } }
Thats maily all.