accelade/actions

Action buttons and modals for Accelade - Filament-style actions with Blade templates

Fund package maintenance!
fadymondy

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/accelade/actions

v1.0.0 2026-01-18 08:14 UTC

This package is auto-updated.

Last update: 2026-01-18 08:17:54 UTC


README

Filament-Style Actions for Accelade

Tests Latest Version Total Downloads License

Build interactive action buttons with modals, confirmations, and server-side execution - all using Accelade's reactive Blade components.

use Accelade\Actions\Action;
use Accelade\Actions\DeleteAction;

// Simple action button
Action::make('save')
    ->label('Save Changes')
    ->icon('check')
    ->color('success')
    ->url(route('posts.store'));

// Delete with confirmation
DeleteAction::make()
    ->url(fn ($record) => route('posts.destroy', $record))
    ->requiresConfirmation()
    ->modalHeading('Delete Post')
    ->modalDescription('Are you sure? This cannot be undone.');

Features

  • Fluent API — Filament-style action builder with chainable methods
  • Confirmation Modals — Built-in confirmation dialogs with customizable text
  • Server Actions — Execute closures on the server via secure AJAX
  • SPA Navigation — Integrates with Accelade's SPA navigation system
  • Multiple Variants — Button, link, and icon-only styles
  • Color Schemes — Primary, secondary, success, danger, warning, info
  • Action Groups — Dropdown menus for multiple actions
  • Authorization — Closure-based authorization checks

Installation

composer require accelade/actions

The package auto-registers with Laravel. To publish assets:

php artisan actions:install

Add to your layout:

<head>
    @actionsStyles
</head>
<body>
    {{ $slot }}

    @actionsScripts
</body>

Quick Start

Basic Action Button

@php
    $action = Action::make('edit')
        ->label('Edit')
        ->icon('pencil')
        ->color('primary')
        ->url(route('posts.edit', $post));
@endphp

<x-actions::action :action="$action" />

Delete with Confirmation

@php
    $deleteAction = DeleteAction::make()
        ->url(route('posts.destroy', $post));
@endphp

<x-actions::action :action="$deleteAction" :record="$post" />

Server-Side Action

@php
    $action = Action::make('publish')
        ->label('Publish')
        ->icon('check')
        ->color('success')
        ->requiresConfirmation()
        ->action(function ($record, $data) {
            $record->update(['published_at' => now()]);
            return ['message' => 'Post published!'];
        });
@endphp

<x-actions::action :action="$action" :record="$post" />

Action Types

Type Description
Action Standard action button
ViewAction Navigate to view page
EditAction Navigate to edit page
CreateAction Navigate to create page
DeleteAction Delete with confirmation
ActionGroup Dropdown menu of actions

Colors

->color('primary')   // Indigo
->color('secondary') // Gray
->color('success')   // Green
->color('danger')    // Red
->color('warning')   // Yellow
->color('info')      // Cyan

Variants

// Standard button (default)
->button()

// Text link style
->link()

// Icon-only button
->iconButton()

// Outlined style
->outlined()

Sizes

->size('xs')  // Extra small
->size('sm')  // Small
->size('md')  // Medium (default)
->size('lg')  // Large
->size('xl')  // Extra large

Confirmation Modal

Action::make('delete')
    ->requiresConfirmation()
    ->modalHeading('Delete Record')
    ->modalDescription('Are you sure you want to delete this?')
    ->modalSubmitActionLabel('Yes, Delete')
    ->modalCancelActionLabel('Cancel')
    ->confirmDanger();

Action Groups

@php
    $group = ActionGroup::make([
        ViewAction::make()->url(route('posts.show', $post)),
        EditAction::make()->url(route('posts.edit', $post)),
        DeleteAction::make()->url(route('posts.destroy', $post)),
    ])->tooltip('Actions');
@endphp

<x-actions::action-group :group="$group" :record="$post" />

Authorization

Action::make('delete')
    ->authorize(fn ($record) => auth()->user()->can('delete', $record))
    ->hidden(fn ($record) => $record->is_protected);

Documentation

Guide Description
Getting Started Installation and setup
Actions Building action buttons
Modals Confirmation dialogs
API Reference Complete API docs

Requirements

  • PHP 8.2+
  • Laravel 11.x or 12.x
  • Accelade 0.1+

License

MIT License. See LICENSE for details.