igoteasy / laravel-stubs
Customize laravel make command by Andrey Sosnov
This package's canonical repository appears to be gone and the package has been frozen as a result.
Requires
- php: >=7.0.0
- laravel/framework: 5.5.*
This package is not auto-updated.
Last update: 2019-12-13 16:20:44 UTC
README
Developed by Andrey Sosnov - atehnix@gmail.com (source)
The package gives you the opportunity to customize Artisan commands like artisan make:model
, artisan make:controller
and other, just as you need.
Any location of the generated classes and with any content.
Installation
You can get library through composer
composer require igoteasy/laravel-stubs
Next up, the service provider
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
should be replaced by
IGotEasy\LaravelStubs\Providers\ConsoleSupportServiceProvider::class,
// config/app.php 'providers' => [ ... // Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, IGotEasy\LaravelStubs\Providers\ConsoleSupportServiceProvider::class, ... ];
To publish the config file to config/stubs.php
run:
php artisan vendor:publish --provider=IGotEasy\LaravelStubs\Providers\ConsoleSupportServiceProvider
Done!
Usage
Configure paths for generated classes
To change the paths of saving the generated classes, you need to configure their namespaces in a configuration file config/stubs.php
.
Publish stub files for edit
php artisan stubs:publish
The files will be placed in the directory resources/stubs
(or other directory if you change it in the configuration file).
Now you can edit any of the stubs and enjoy your customized commands like artisan make:model
, artisan make:controller
and others.