lundi 29 mai 2017

how to add artisan command to my package laravel

SO i developed a custom package in Laravel 5.4, i add my route,my controllers but i have no idea how to add a artisan command, this is my code :

namespace MyPackage;

use Illuminate\Support\ServiceProvider;

class MyPackageServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        include __DIR__.'/routes.php';
    }

    /**
    * Register the application services.
    *
    * @return void
    */
    public function register()
    {
      $this->app->make('MyPackage\Controllers\MyPackageServiceController');
    }
}

Normally in the usual case i add a new artisan command and add it to app/Console/Commands/Kernel.php, so how can i do that inside my package ?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2s65DzY
via IFTTT

Aucun commentaire:

Enregistrer un commentaire