Simple but yet powerful library for running almost all artisan commands.

Overview

Artisan GUI

:artisan gui

Packagist License Packagist Version Packagist Downloads Packagist PHP Version Support GitHub code size in bytes

Simple but yet powerful library for running some artisan commands.

Requirements

  • Laravel 8.*
  • php ^7.3

Installation

Just install package:

composer require infureal/artisan-gui

Installing 2.0.0@beta

composer require infureal/artisan-gui:2.0.0@beta

Vendor publishing

By default package has predefined config and inline styles and scripts. Since version 1.4 you can publish vendors like css and js files in vendor/artisan-gui:

php artisan vendor:publish --provider="Infureal\Providers\GuiServiceProvider"

Publish only config:

php artisan vendor:publish --tag="artisan-gui-config"

Publish only styles and scripts:

php artisan vendor:publish --tag="artisan-gui-css-js"

Running command

By default, you can access this page only in local environment. If you wish you can change local key in config.

Simply go to http://you-domain.com/~artisan and here we go! Select needed command from list, fill arguments and options/flags and hit run button.

What's new in v2

  • Moved to SPA/Vue
  • UI changed to more readable (IMHO)
  • Implementing search (with new design it's hard to find some command without search)
  • Added permission field to config (for more flexible adjustment)
  • Added array option fields

Configuration

Default config is:



return [

    /*
    |--------------------------------------------------------------------------
    | Middleware list for web routes
    |--------------------------------------------------------------------------
    |
    | You can pass any middleware for routes, by default it's just [web] group
    | of middleware.
    |
    */
    'middlewares' => [
        'web',
//        'auth'
    ],

    /*
    |--------------------------------------------------------------------------
    | Route prefix
    |--------------------------------------------------------------------------
    |
    | Prefix for gui routes. By default url is [/~artisan-gui].
    | For your wish you can set it for example 'my-'. So url will be [/my-artisan-gui].
    |
    | Why tilda? It's selected for prevent route names correlation.
    |
    */
    'prefix' => '~',

    /*
    |--------------------------------------------------------------------------
    | Home url
    |--------------------------------------------------------------------------
    |
    | Where to go when [home] button is pressed
    |
    */
    'home' => '/',

    /*
    |--------------------------------------------------------------------------
    | Only on local
    |--------------------------------------------------------------------------
    |
    | Flag that preventing showing commands if environment is on production
    |
    */
    'local' => true,
    
    /*
    |--------------------------------------------------------------------------
    | List of command permissions
    |--------------------------------------------------------------------------
    |
    | Specify permissions to every single command. Can be a string or array
    | of permissions
    |
    | Example:
    |   'make:controller' => 'create-controller',
    |   'make:event' => ['generate-files', 'create-event'],
    |
    */
    'permissions' => [
    ],
    
    /*
    |--------------------------------------------------------------------------
    | List of commands
    |--------------------------------------------------------------------------
    |
    | List of all default commands that has end of execution. Commands like
    | [serve] not supported in case of server side behavior of php.
    | Keys means group. You can shuffle commands as you wish and add your own.
    |
    */
    'commands' => [
        // ...
    ]

];

Issues

If have any issue please write me.

Comments
  • Version 1.4.1 doesn't work with laravel jetsream livewire stack

    Version 1.4.1 doesn't work with laravel jetsream livewire stack

    Hi, Thanks for this great package, i discovered the latest version 1.4.1 is incompatible with laravel Jetstream livewire stack, I used jetstream and this package, it works great with version 1.3, but after update all packages, i got error 'Livewire\Exceptions\ComponentNotFoundException' Unable to find component: [profile.update-profile-information-form], the same message for all Laravel Jetstream livewire components. It's took me 2 days to debug and finally found this issue related to this package and specially version 1.4.1, after came back to version 1.3 o this package my app works fine again.

    opened by dukenst2006 5
  • Error HTTPS

    Error HTTPS

    image

    return [
    
        /*
        |--------------------------------------------------------------------------
        | Middleware list for web routes
        |--------------------------------------------------------------------------
        |
        | You can pass any middleware for routes, by default it's just [web] group
        | of middleware.
        |
        */
        'middlewares' => [
            'web',
            'auth',
            'role:' . App\Enums\UserType::ADMIN,
        ],
    
        /*
        |--------------------------------------------------------------------------
        | Route prefix
        |--------------------------------------------------------------------------
        |
        | Prefix for gui routes. By default url is [/~artisan-gui].
        | For your wish you can set it for example 'my-'. So url will be [/my-artisan-gui].
        |
        | Why tilda? It's selected for prevent route names correlation.
        |
        */
        'prefix' => '~',
    
        /*
        |--------------------------------------------------------------------------
        | Home url
        |--------------------------------------------------------------------------
        |
        | Where to go when [home] button is pressed
        |
        */
        'home' => '/',
    
        /*
        |--------------------------------------------------------------------------
        | Only on local
        |--------------------------------------------------------------------------
        |
        | Flag that preventing showing commands if environment is on production
        |
        */
        'local' => false,
    
        /*
        |--------------------------------------------------------------------------
        | List of command permissions
        |--------------------------------------------------------------------------
        |
        | Specify permissions to every single command. Can be a string or array
        | of permissions
        |
        | Example:
        |   'make:controller' => 'create-controller',
        |   'make:event' => ['generate-files', 'create-event'],
        |
        */
        'permissions' => [
        ],
    
        /*
        |--------------------------------------------------------------------------
        | List of commands
        |--------------------------------------------------------------------------
        |
        | List of all default commands that has end of execution. Commands like
        | [serve] not supported in case of server side behavior of php.
        | Keys means group. You can shuffle commands as you wish and add your own.
        |
        */
        'commands' => [
            'laravel' => [
                'clear-compiled',
                'down',
                'up',
                'env',
                // 'help',
                'inspire',
                'list',
                'notifications:table',
                'package:discover',
                'schedule:run',
                // 'schema:dump',
                'session:table',
                // 'storage:link',
                // 'stub:publish',
                'auth:clear-resets',
                'tail',
            ],
            'optimize' => [
                'optimize',
                'optimize:clear',
            ],
            'cache' => [
                'cache:clear',
                'cache:forget',
                'cache:table',
                'config:clear',
                'config:cache',
            ],
            /*
            'database' => [
                'db:seed',
                'db:wipe',
            ],
            */
            'events' => [
                'event:cache',
                'event:clear',
                'event:generate',
                'event:list',
            ],
            /*
            'make' => [
                'make:cast',
                'make:channel',
                'make:command',
                'make:component',
                'make:controller',
                'make:event',
                'make:exception',
                'make:factory',
                'make:job',
                'make:listener',
                'make:mail',
                'make:middleware',
                'make:migration',
                'make:model',
                'make:notification',
                'make:observer',
                'make:policy',
                'make:provider',
                'make:request',
                'make:resource',
                'make:rule',
                'make:seeder',
                'make:test',
            ],
            */
            'migrate' => [
                // 'migrate',
                // 'migrate:fresh',
                // 'migrate:install',
                // 'migrate:refresh',
                // 'migrate:reset',
                // 'migrate:rollback',
                'migrate:status',
            ],
            /*
            'queue' => [
                'queue:batches-table',
                'queue:clear',
                'queue:failed',
                'queue:failed-table',
                'queue:flush',
                'queue:forget',
                'queue:restart',
                'queue:retry',
                'queue:retry-batch',
                'queue:table',
            ],
            */
            'route' => [
                'route:cache',
                'route:clear',
                'route:list',
            ],
            'view' => [
                'view:cache',
                'view:clear',
            ],
            'backup' => [
                'backup:clean',
                'backup:list',
                'backup:monitor',
                // 'backup:run',
            ],
            'responsecache' => [
                'responsecache:clear',
            ],
            'opcache' => [
                'opcache:clear',
                'opcache:compile',
                'opcache:config',
                'opcache:status',
            ],
            'schedule-monitor' => [
                'schedule-monitor:list',
            ],
        ],
    
    ];
    
    opened by Oxicode 4
  • Tag version incompatibility with Plesk Composer

    Tag version incompatibility with Plesk Composer

    Im using Plesk (panel website admin) extension to manage composer packages. It's gives me error with tag name 2.0.0@beta presumably by the @ . Could you change next tag version to a name without @ . I will try no notify Plesk plugin developer. Thanks.

    opened by branigan 3
  • Flag to force https on endpoint

    Flag to force https on endpoint

    This PR addresses the issue https://github.com/inFureal/artisan-gui/issues/26 and adds an optional flag to force HTTPS when passing the endpoint and home parameters as props

    opened by FelipeOAlbert 2
  • Not displaying anymore

    Not displaying anymore

    Hello,

    I've been using artisan-gui for over a month now and I really like it. I wanted to try the beta and now I only get a blank page. I tried removing and reinstalling the current version but there's the same issue.

    Kind regards,

    opened by JacquesLG 2
  • Limit access to specific users

    Limit access to specific users

    Maybe it would be possible that if, when in production, it would only allow certain users to access the routes?

    this would make it really useful for people on shared hosting with no access to SSH

    opened by RhysLees 2
  • Allow list/run specific commands based on authorization

    Allow list/run specific commands based on authorization

    Hi,

    It could be very nice to be able to only display/run commands depending on Gate authorization.

    For example, the commands list from config file could be something like:

    'commands' => [
        'group-name' => [
            'foo:bar',    // Ok for everyone (who can access artisan gui)
            'can-run-baz' => 'baz'// Only for users with permission 'can-run-baz'
        ]
    ]
    

    It requires to read the list before building the gui panel. Something like:

    use Gate;
    
    class GuiController extends Controller {
        use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
    
        function index() {
            $commands = array_filter(config('artisan-gui.commands', []), function ($command, $permission) {
                return is_string($permission) ? Gate::allows($permission) : true;
            },  ARRAY_FILTER_USE_BOTH);
            return view('gui::index', [
                'commands' => array_values($commands)
            ]);
        }
    

    This is raw code just to get the idea, a method should retrieve the filtered commands. Permission should also be checked before runningg the command.

    This feature should not introduce any BC. I may provide a PR if you're ok with this.

    enhancement good first issue 
    opened by Arcesilas 2
  • Adds ability to add middlewares from config itself

    Adds ability to add middlewares from config itself

    This pull request adds an ability to add middleware from config itself. This ability opens a lot of abilities like adding some role/permission middleware to the route so it can be accessed only by user having certain permissions/role.

    opened by saineshmamgain 2
  • 404 on ~/artisan

    404 on ~/artisan

    Laravel: 8.54 PHP: 7.4 artisan-gui 2.0.0@beta

    Hi there,

    Just installed this in my project:

    • composer require infureal/artisan-gui:2.0.0@beta
    • php artisan vendor:publish --tag="artisan-gui-config"
    • set local to false
    • enable auth middleware
    • prefix => '~'

    When visiting localhost:3000/~artisan of localhost:3000/~artisan-gui it just throws a 404. I checked my route list and it doesn't contain anything related to artisan-gui. Am I missing something?

    Thanks in advance. Great project :)

    opened by barbershopdawo 1
  • Undefined constant STDIN when command is interactive

    Undefined constant STDIN when command is interactive

    Hello

    I encounter an issue (beta v2) while trying command with interactive question (using $this->ask() or variant of it). Do you plan to support this in the next version?

    This code will produce an error

    exception: "Error"
    file: "/home/vagrant/code/platform/vendor/symfony/console/Helper/QuestionHelper.php"
    line: 113
    message: "Undefined constant \"STDIN\""
    

    Code example to reproduce the issue :

    class MyTestCommand extends Command
    {
    	protected $signature = 'test';
    	protected $description = 'Test command';
    
    	public function handle()
    	{
    
    		$this->ask('hello ? ');
    
    		return 0;
    	}
    }
    
    opened by jeremy379 1
  • "Prompting For Input" type command not working.

    opened by mhmiton 1
  • Open side modal when click on command without args/options

    Open side modal when click on command without args/options

    Hey,

    When you have a command without arguments or options, if you click on command, it should show the modal and force you to click on RUN, instead of running the command right away.

    Right now if you click, shows only the "running icon"

    image

    It's danger without that. :D

    opened by rguedes 1
  • New package based on current

    New package based on current

    Hello there. 👋 I have plans to rework this package, adding new features besides running commands. First, I ask @Catzilla, @saineshmamgain to contact me if you are free to work together.

    ℹ️ This package is not abbandoned. As far as possible, I will fix bugs and improve functionality. But most of the time will be spent on a new package.

    What are the plans for the new package:

    • Handling STDIN/STDOUT with somthing like ChildProcess and ReactPHP itself
    • Show more information about laravel app such as migration status etc.
    • Reworking UI/UX.
      • If you have good examples of UI, you can attach them.
    • Support for custom handlers and plugn support.
      • Need to thing about the architecture

    Feel free to write your wishes in this issue.

    enhancement 
    opened by infureal 2
Releases(v2.0.1-beta2)
Handle signals in artisan commands

Using this package you can easily handle signals like SIGINT, SIGTERM in your Laravel app.

Spatie 96 Dec 29, 2022
A Cli tool to save you time, and gives you the power to scaffold all of your models,controllers,commands

A Cli tool to save you time, and gives you the power to scaffold all of your models,controllers,commands... at once Installation You can install the p

Coderflex 16 Nov 11, 2022
Backup your laravel database by a simple artisan command

Backup your laravel database by a simple artisan command This package will allow you to backup your laravel app database and you can also choose to se

Mohammed Omer 23 Feb 10, 2022
[ABANDONED] PHP library for executing commands on multiple remote machines, via SSH

#Shunt Inspired by Ruby's Capistrano, Shunt is PHP library for executing commands on multiple remote machines, via SSH. Specifically, this library was

The League of Extraordinary Packages 436 Feb 20, 2022
Library for creating CLI commands or applications

Console Motivation: this library purpose is to provide a lighter and more robust API for console commands and/or applications to symfony/console. It c

Théo FIDRY 16 Dec 28, 2022
PHP library for executing commands on multiple remote machines, via SSH

#Shunt Inspired by Ruby's Capistrano, Shunt is PHP library for executing commands on multiple remote machines, via SSH. Specifically, this library was

The League of Extraordinary Packages 436 Feb 20, 2022
A simple object oriented interface to execute shell commands in PHP

php-shellcommand php-shellcommand provides a simple object oriented interface to execute shell commands. Installing Prerequisites Your php version mus

Michael Härtl 283 Dec 10, 2022
Display your Laravel routes in the console, but make it pretty. 😎

Pretty Routes for Laravel Display your Laravel routes in the console, but make it pretty. ?? Installation You can install the package via composer: co

Alex 630 Dec 30, 2022
It's like Tailwind CSS, but for the console.

Tailcli allows building unique, beautiful command-line applications, using tailwind classes. It's like Tailwind CSS, but for the console. Installation

Nuno Maduro 1.8k Jan 7, 2023
🍃 In short, it's like Tailwind CSS, but for the PHP command-line applications.

Termwind Termwind allows you to build unique and beautiful PHP command-line applications, using the Tailwind CSS API. In short, it's like Tailwind CSS

Nuno Maduro 1.8k Dec 30, 2022
YAPS - Yet Another PHP Shell

YAPS - Yet Another PHP Shell Yeah, I know, I know... But that's it. =) As the name reveals, this is yet another PHP reverse shell, one more among hund

Nicholas Ferreira 60 Dec 14, 2022
Command-line control panel for Nginx Server to manage WordPress sites running on Nginx, PHP, MySQL, and Let's Encrypt

EasyEngine v4 EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volume

EasyEngine 2k Jan 4, 2023
Customized loading ⌛ spinner for Laravel Artisan Console.

Laravel Console Spinner Laravel Console Spinner was created by Rahul Dey. It is just a custom Progress Bar inspired by icanhazstring/symfony-console-s

Rahul Dey 71 Oct 26, 2022
A developer-friendly wrapper around execution of shell commands.

ptlis/shell-command A developer-friendly wrapper around execution of shell commands. There were several goals that inspired the creation of this packa

brian ridley 18 Dec 31, 2022
A package built for lumen that ports most of the make commands from laravel.

A package built for lumen that ports most of the make commands from laravel. For lumen v5.1, but will most likely work for 5.2 as well. I haven't tested. If you have requests, let me know, or do it yourself and make a pull request

Michael Bonds 22 Mar 8, 2022
Supercharge your Symfony console commands!

zenstruck/console-extra A modular set of features to reduce configuration boilerplate for your commands: /** * Creates a user in the database. * *

Kevin Bond 29 Nov 19, 2022
🤖 GitHub Action to run symfony console commands.

Symfony Console GitHub Action Usage You can use it as a Github Action like this: # .github/workflows/lint.yml name: "Lint" on: pull_request: push

Nucleos 3 Oct 20, 2022
Helper commands for Laravel Beyond Crud

About beyond-crud-helpers This package has many helper commands for the Laravel BEyond CRUD project by Spatie Installation composer require --dev tarr

null 4 Mar 8, 2022
A PocketMine-MP plugin which allows the users to edit no permission message of commands

CommandPermissionMessage A PocketMine-MP plugin which allows the users to edit no permission message of commands Have you ever got bored by the red me

cosmicnebula200 3 May 29, 2022