Looking to hire Laravel developers? Try LaraJobs

laravel-console-over-http maintained by outl1ne

Description
Run console commands over HTTP connection for Laravel applications.
Last update
2024/04/26 09:51 (dev-main)
License
Links
Downloads
16 159

Comments
comments powered by Disqus

Laravel Console over HTTP

Latest Version on Packagist Total Downloads

Run console commands over HTTP connection for Laravel applications.

Creates a route with a path /console that runs the command from HTTP parameters in a console.

Usage

In routes/web.php add a line:

ConsoleOverHttp::endpoint();

Configure an environment variable CONSOLE_OVER_HTTP_TOKEN to secure the endpoint.

Visit the route in your app, e.g. http://localhost:4000/console?command=php%20artisan%20inspire&token=your-token

Example - insecure usage

ConsoleOverHttp::endpoint()->insecure();

Or set the environment variable CONSOLE_OVER_HTTP_INSECURE=true.

Example - custom authentication logic

ConsoleOverHttp::endpoint()->auth(function () {
    return \Auth::check();
});

Installation

Install the package in a Laravel project via Composer:

composer require outl1ne/laravel-console-over-http

Credits

License

Laravel Console over HTTP is open-sourced software licensed under the MIT license.