Skip to content

Zwartpet/laravel-command-ui

Repository files navigation

Laravel Command UI

Latest Version on Packagist Test

Add an admin interface where you can run Laravel commands without the need to SSH into the server.

Installation

You can install the package via composer:

composer require zwartpet/command-ui

Publish the assets

php artisan vendor:publish --tag=command-ui-assets

Usage

The UI is available on the /command-ui route, configurable with COMMAND_UI_URI in your .env file.

The route is protected with a Laravel Gate named command-ui which you can customize with COMMAND_UI_GATE in your .env file. Create the gate by adding the following to your AuthServiceProvider, not adding this will result in a 404 error when visiting the route.

Gate::define('command-ui', function (User $user) {
    return $user->isAdmin; // or any other logic
});

Configuration

This library is plug and play and works out of the box. There are some configuration options available.

The list of commands is filtered by a blacklist or whitelist, by default the blacklist is used.
Publish the configuration to change the lists to your needs.

php artisan vendor:publish --tag=command-ui-config

For all the configuration options see the config file.

Testing

Pest

composer test

Pint

composer test:lint

PHPStan

composer test:types

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

About

Run laravel commands from a web page

Resources

License

Stars

Watchers

Forks

Packages

No packages published