cedricziel / l5-webartisan by cedricziel

Artisan for the web. Execute Artisan command on a webpage.
64
1
3
Package Data
Maintainer Username: cedricziel
Maintainer Contact: cedric@cedric-ziel.com (Cedric Ziel)
Package Create Date: 2016-01-04
Package Last Update: 2016-01-22
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-15 15:01:24
Package Statistics
Total Downloads: 64
Monthly Downloads: 1
Daily Downloads: 0
Total Stars: 1
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

Webartisan for Laravel 5

Provides a browser-based artisan console for your application.

Warning!

This addon is insecure by default! You need to secure the endpoints or strangers will execute commands on your application.

Configuration

Add the ServiceProvider to config/app.php:

    CedricZiel\Webartisan\WebartisanServiceProvider:class,

Now you need to override the routes shipped by the plugin, to secure them with a middleware of your choice.

Here's an example to secure the endpoints with the auth middleware (app/Providers/RouteServiceProvider):

    /**
     * Define the routes for the application.
     *
     * @param  \Illuminate\Routing\Router $router
     *
     * @return void
     */
    public function map(Router $router)
    {
        $router->group(['namespace' => $this->namespace], function ($router) {
            require app_path('Http/routes.php');
        });

        /**
         * Webartisan routes
         */
        $router->group([
            'namespace'  => '\CedricZiel\Webartisan\Http\Controllers',
            'middleware' => ['web', 'auth']
        ], function ($router) {
            Route::get('artisan', [
                'as'         => 'artisan',
                'middleware' => 'auth',
                'uses'       => 'WebartisanController@show'
            ]);

            Route::post('artisan', [
                'as'         => 'artisan',
                'middleware' => 'auth',
                'uses'       => 'WebartisanController@execute'
            ]);
        });
    }

License & Credits

This library is based on the work of Ron Shpasser (https://github.com/shpasser/GaeSupportL5).

This library is licensed under the MIT License.