Fluent bulk actions for Laravel index pages. Each action is authorized through Laravel's Gate, can ask for input with a stencil form, and runs on the selected records or on everything matching the current filters, chunked and queued for large selections. The selection and action UI ships for Blade (javaabu/forms) and Inertia React (@javaabu/forms).
class ArticleBulkActions extends BulkActions
{
protected ?string $model = Article::class;
protected function actions(): array
{
return [
DeleteAction::make()->can('delete_articles'),
Action::make('change_status')
->label(__('Change status'))
->canEach('update')
->form([Select::make('status')->options(ArticleStatuses::class)->required()])
->each(fn (Article $article, array $data) => $article->update($data)),
];
}
}Route::bulkActions('articles', ArticleBulkActions::class);<x-forms::table model="articles">
<x-slot:bulk-form :action="$bulk_actions->getUrl()">
<x-bulk-actions::actions :actions="$bulk_actions" :paginator="$articles" />
</x-slot:bulk-form>
…
</x-forms::table><BulkActionsTable bulkActions={bulkActions}>{rows}</BulkActionsTable>You'll find the documentation on https://docs.javaabu.com/docs/bulk-actions, and in docs/. AI assistants: start with llms.txt; Laravel Boost picks up the guideline and the javaabu-bulk-actions skill from the package.
composer test
pnpm install && pnpm testPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email info@javaabu.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.