nasrulhazim / artisanmakers
Laravel Artisan Makers
Installs: 42
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/nasrulhazim/artisanmakers
Requires
- illuminate/console: 5.5.*
- illuminate/support: 5.5.*
This package is auto-updated.
Last update: 2022-02-01 13:10:51 UTC
README
This package extend the capbilities of Laravel Artisan Make Command.
Installation
composer require nasrulhazim/artisanmakers
Open up app/Providers/AppServiceProvider.php and register the service provider as following:
if ($this->app->environment() !== 'production') { $this->app->register(\NasrulHazim\ArtisanMakers\ArtisanMakersServiceProvider::class); }
Usage
Type php artisan --help for more details.
Available Commands
-
Contracts:
php artisan make:contract ContractName -
Exceptions:
php artisan make:exception NewExceptionClassName -
Macros:
php artisan make:macro ClassName -
Model:
php artisan make:mode ModelName- This will create models under
app/Modelsdirectory instead ofappdirectory by default. - Register manually in your application in
app/Console/Kernel.phpin$commandsproperty. Not sure why the command didn't load in the package. Probably it's loaded, by overwrite by defaultmake:modelcommand.
protected $commands = [ \NasrulHazim\ArtisanMakers\Console\Commands\MakeModelCommand::class, ];
- This will create models under
-
Observer:
php artisan make:observer ObserverClassName ModelToObserveTODO
- Create
ObserverServiceProvider - Create
Observerclass - Register
ObserverServiceProviderinconfig/app.php - Include model & observer namespace in
ObserverServiceProvider - Bootstrap Observer in
ObserverServiceProvider
- Create
-
Presenters:
php artisan make:presenter PresenterClassName -
Processors:
php artisan make:processor ProcessorClassName -
Repositories:
php artisan make:repository RepositoryClassName -
Resourceful:
php artisan make:resourceful ClassName -
Services:
php artisan make:service ServiceClassName -
Traits:
php artisan make:trait TraitClassName -
Transformers:
php artisan make:transformer TransformerClassName
License
This package is open-sourced software licensed under the MIT license.