Complete action system with modal support, authorization, and Inertia.js integration for Laravilt. Build interactive UI components with buttons, links, and icon buttons. Includes confirmation modals, custom forms, password protection, and secure token-based execution.
- π¨ Multiple Variants - Button, link, and icon button styles
- π Authorization - Closure-based authorization with record-level checks
- π Modal Support - Confirmation modals, custom forms, slide-overs
- π― Flexible Configuration - Colors, icons, sizes, tooltips
- π URL Handling - External URLs, internal actions, new tab support
- β‘ Inertia Integration - Seamless Vue 3 integration
- π€ Export/Import - Excel/CSV export and import with Laravel Excel
- π Soft Delete Support - Built-in restore and force delete actions
| Type | Description |
|---|---|
Action |
Standard action button |
BulkAction |
Action for multiple selected records |
ViewAction |
Navigate to view page |
EditAction |
Navigate to edit page |
DeleteAction |
Soft delete record |
CreateAction |
Navigate to create page |
ReplicateAction |
Duplicate a record |
RestoreAction |
Restore soft-deleted record |
ForceDeleteAction |
Permanently delete record |
ExportAction |
Export data to Excel/CSV |
ImportAction |
Import data from Excel/CSV |
DeleteBulkAction |
Bulk soft delete |
RestoreBulkAction |
Bulk restore |
ForceDeleteBulkAction |
Bulk permanent delete |
->color('primary') // Blue
->color('secondary') // Gray
->color('success') // Green
->color('danger') // Red
->color('warning') // Yellow
->color('info') // Light blue// Confirmation modal
->requiresConfirmation()
->modalHeading('Delete User')
->modalDescription('Are you sure?')
// Form modal
->schema([
TextInput::make('reason')->required(),
])
// Slide-over
->slideOver()composer require laravilt/actionsThe package will automatically register its service provider.
use Laravilt\Actions\Action;
$action = Action::make('delete')
->label('Delete')
->icon('trash-2')
->color('danger')
->requiresConfirmation()
->modalHeading('Delete User')
->modalDescription('Are you sure?')
->action(function ($record) {
$record->delete();
});use Laravilt\Actions\ExportAction;
use Laravilt\Actions\ImportAction;
// Export with custom exporter class
ExportAction::make()
->exporter(UserExporter::class)
->fileName('users.xlsx');
// Import with custom importer class
ImportAction::make()
->importer(UserImporter::class);use Laravilt\Actions\DeleteAction;
use Laravilt\Actions\RestoreAction;
use Laravilt\Actions\ForceDeleteAction;
// Auto-hidden for trashed records
DeleteAction::make();
// Auto-visible only for trashed records
RestoreAction::make();
ForceDeleteAction::make();use Laravilt\Actions\ReplicateAction;
ReplicateAction::make()
->excludeAttributes(['slug', 'published_at'])
->beforeReplicaSaved(fn ($replica) => $replica->name .= ' (Copy)')
->afterReplicaSaved(fn ($replica) => /* post-save logic */);# Generate an action class
php artisan make:action ExportUserAction
# Generate an exporter class for ExportAction
php artisan laravilt:exporter UserExporter
php artisan laravilt:exporter CustomerExporter --model=Customer
# Generate an importer class for ImportAction
php artisan laravilt:importer UserImporter
php artisan laravilt:importer CustomerImporter --model=Customer- Complete Documentation - Full feature guide, API reference, and examples
- MCP Server Guide - AI agent integration
Publish the config file:
php artisan vendor:publish --tag="laravilt-actions-config"Publish the plugin assets:
php artisan vendor:publish --tag="laravilt-actions-assets"composer testcomposer formatcomposer analyseThe MIT License (MIT). Please see License File for more information.
