iamgerwin/filament-artisan-panel

A beautiful Filament panel for running Artisan commands with variable inputs, command history, and progress tracking

v1.0.0 2025-09-29 17:46 UTC

This package is auto-updated.

Last update: 2025-09-29 17:49:44 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A beautiful and powerful Filament panel for running Artisan commands with ease. Execute predefined or custom commands, track command history, and manage your Laravel application directly from your Filament admin panel.

Perfect for those moments when you need to clear the cache but your SSH keys are sleeping, or when you want to migrate without opening a terminal. Because sometimes, clicking buttons is just more fun than typing commands. 🚀

Features

  • 🎨 Beautiful UI - Intuitive card-based interface with grouped commands
  • âš¡ Quick Actions - Run common Artisan commands with a single click
  • 🔧 Custom Commands - Execute custom Artisan and bash commands (optional)
  • 📊 Command History - Track all executed commands with success/failure status
  • 🎯 Dynamic Options - Support for command options and flags
  • 🔒 Safety First - Confirmation dialogs for destructive operations
  • 🎭 Dark Mode - Full support for Filament's dark mode
  • 📦 Pre-configured - Ships with common Laravel commands out of the box
  • 🚀 Queue Support - Queue long-running commands (optional)
  • 🎨 Customizable - Full configuration control over appearance and behavior

Requirements

  • PHP 8.3 or higher
  • Laravel 11.x or 12.x
  • Filament 4.x

Installation

You can install the package via Composer:

composer require iamgerwin/filament-artisan-panel

Optionally, publish the configuration file:

php artisan vendor:publish --tag="filament-artisan-panel-config"

Optionally, publish the views:

php artisan vendor:publish --tag="filament-artisan-panel-views"

Usage

Register the Plugin

Register the plugin in your Filament panel configuration:

use Iamgerwin\FilamentArtisanPanel\FilamentArtisanPanelPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentArtisanPanelPlugin::make(),
        ]);
}

That's it! The Artisan Panel will now appear in your Filament navigation.

Configuration

The package ships with sensible defaults, but you can customize everything in the config file:

return [
    'navigation' => [
        'enabled' => true,
        'label' => 'Artisan Commands',
        'icon' => 'heroicon-o-command-line',
        'sort' => null,
        'group' => null,
    ],

    'history' => [
        'enabled' => true,
        'limit' => 50,
    ],

    'allow_custom_artisan_commands' => false,
    'allow_custom_bash_commands' => false,

    'execution' => [
        'timeout' => 300,
        'prevent_simultaneous_execution' => false,
    ],
];

Adding Custom Commands

You can define your own commands in the configuration file:

'commands' => [
    [
        'label' => 'Clear Cache',
        'command' => 'cache:clear',
        'type' => 'artisan',
        'group' => 'Cache',
        'icon' => 'heroicon-o-trash',
        'color' => 'danger',
        'confirmation' => false,
        'help' => 'Clear the application cache',
    ],
    [
        'label' => 'Run Migrations',
        'command' => 'migrate',
        'type' => 'artisan',
        'group' => 'Database',
        'icon' => 'heroicon-o-circle-stack',
        'color' => 'primary',
        'confirmation' => true,
        'help' => 'Run the database migrations',
        'options' => [
            [
                'name' => '--force',
                'label' => 'Force',
                'type' => 'checkbox',
                'help' => 'Force in production',
            ],
        ],
    ],
],

Command Options

Commands can have dynamic options that users can configure before execution:

'options' => [
    [
        'name' => '--force',      // The command option name
        'label' => 'Force',       // Display label
        'type' => 'checkbox',     // Input type (checkbox, text, number, select)
        'help' => 'Force the operation',
    ],
    [
        'name' => '--step',
        'label' => 'Steps',
        'type' => 'number',
        'help' => 'Number of steps',
    ],
],

Security Considerations

By default, custom commands are disabled for security reasons. If you want to allow users to run custom commands:

'allow_custom_artisan_commands' => true,  // Allow custom artisan commands
'allow_custom_bash_commands' => false,     // Keep bash commands disabled (recommended)

Warning: Enabling custom commands, especially bash commands, can be a security risk. Only enable this for trusted users in secure environments.

Command History

The package tracks all executed commands, storing:

  • Command name and parameters
  • Execution timestamp
  • Success/failure status
  • Output (for failed commands)

You can configure history tracking:

'history' => [
    'enabled' => true,
    'limit' => 50,  // Maximum number of history entries
],

History is stored in the application cache and can be cleared using the "Clear History" button in the panel.

Pre-configured Commands

The package comes with these commands out of the box:

Cache Management

  • Clear Cache
  • Clear Config Cache
  • Clear Route Cache
  • Clear View Cache

Optimization

  • Optimize Application
  • Clear Optimization

Database

  • Run Migrations
  • Rollback Migrations
  • Seed Database

Queue

  • Queue Work
  • Queue Restart

Storage

  • Storage Link

Testing

Run the test suite:

composer test

Run PHPStan:

composer analyse

Run code style fixer:

composer format

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Security

If you discover any security-related issues, please email iamgerwin@live.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.