About Your Package
, (*1)
This is a extended artisan make command., (*2)
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, (*3)
$ php artisan make:contract ContractName
Exceptions, (*4)
$ php artisan make:exception NewExceptionClassName
Model, (*5)
$ php artisan make:mode ModelName`
This will create models under app/Models
directory instead of app
directory by default., (*6)
Register manually in your application in app/Console/Kernel.php
in $commands
property. Not sure why the command didn't load in the package., (*7)
protected $commands = [
\CleaniqueCoders\ArtisanMakers\Console\Commands\MakeModelCommand::class,
];
Observer, (*8)
$ php artisan make:observer ObserverClassName ModelToObserve
TODO, (*9)
- [x] Create
ObserverServiceProvider
- [x] Create
Observer
class
- [ ] Register
ObserverServiceProvider
in config/app.php
- [ ] Include model & observer namespace in
ObserverServiceProvider
- [ ] Bootstrap Observer in
ObserverServiceProvider
Presenter, (*10)
Presenter is generic class to help generate consistent HTML element., (*11)
$ php artisan make:presenter PresenterClassName
Processors, (*12)
Processor use to generate core processing of the application. This can be a payroll processor, leave approval processor., (*13)
$ php artisan make:processor ProcessorClassName
Repositories TODO, (*14)
Apply repository pattern., (*15)
$ php artisan make:repository RepositoryClassName
Services, (*16)
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., (*17)
$ php artisan make:service ServiceClassName
Traits, (*18)
$ php artisan make:trait TraitClassName
Transformers, (*19)
Tranformer use to transform from one to another data structure, depends on the domain concern., (*20)
$ php artisan make:transformer TransformerClassName
License
This package is open-sourced software licensed under the MIT license., (*21)