cleaniquecoders / artisan-makers
Built with Laravel Standalone Package Creator
Installs: 1 868
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.2
- illuminate/support: ^5.5|^5.6|^5.7|^5.8
Requires (Dev)
- orchestra/testbench: 3.5.*|3.6.*|3.7.*|3.8.*
- phpunit/phpunit: ^6.5|^7.0|^8.0
This package is auto-updated.
Last update: 2020-09-28 05:30:15 UTC
README
This is a extended artisan make command.
Installation
- In order to install
cleaniquecoders/artisan-makers
in your Laravel project, just run the composer require command from your terminal:
composer require cleaniquecoders/artisan-makers
- Then in your
config/app.php
add the following to the providers array:
CleaniqueCoders\ArtisanMakers\ArtisanMakersServiceProvider::class,
- In the same
config/app.php
add the following to the aliases array:
'ArtisanMakers' => CleaniqueCoders\ArtisanMakers\ArtisanMakersFacade::class,
Usage
Contracts
$ php artisan make:contract ContractName
Exceptions
$ php artisan make:exception NewExceptionClassName
Model
$ php artisan make:mode ModelName`
This will create models under app/Models
directory instead of app
directory by default.
Register manually in your application in app/Console/Kernel.php
in $commands
property. Not sure why the command didn't load in the package.
protected $commands = [ \CleaniqueCoders\ArtisanMakers\Console\Commands\MakeModelCommand::class, ];
Observer
$ php artisan make:observer ObserverClassName ModelToObserve
TODO
- Create
ObserverServiceProvider
- Create
Observer
class - Register
ObserverServiceProvider
inconfig/app.php
- Include model & observer namespace in
ObserverServiceProvider
- Bootstrap Observer in
ObserverServiceProvider
Presenter
Presenter is generic class to help generate consistent HTML element.
$ php artisan make:presenter PresenterClassName
Processors
Processor use to generate core processing of the application. This can be a payroll processor, leave approval processor.
$ php artisan make:processor ProcessorClassName
Repositories TODO
Apply repository pattern.
$ php artisan make:repository RepositoryClassName
Services
Services is something that a domain provide to external. A total hours of overtime need to be provide to payroll domain in order to calculate total claimable overtime.
$ php artisan make:service ServiceClassName
Traits
$ php artisan make:trait TraitClassName
Transformers
Tranformer use to transform from one to another data structure, depends on the domain concern.
$ php artisan make:transformer TransformerClassName
License
This package is open-sourced software licensed under the MIT license.