rifrocket / trait-console
Console command to create Traits for the Laravel
Requires
- php: ^7.1
- illuminate/console: ~5.5.0|~5.6.0|~5.7.0|~5.8.0|~6.0|7.0|^8.0
- illuminate/support: ~5.5.0|~5.6.0|~5.7.0|~5.8.0|~6.0|7.0|^8.0
README
Laravel does not provide the command to create Traits out of the box but Laravel does provide commands generation for almost all kinds of components. This package introduces the convenience of Laravel's artisan makes for trait generation.
Installation
You can install the package via composer:
composer require rifrocket/trait-console
Registering the service provider
For Laravel 5.4 and lower, add the following line to your config/app.php
Rifrocket\TraitConsole\TraitConsoleServiceProvider::class,
Usage
trait will be created in the App/Traits directory.
php artisan make:trait NameOfYourTrait
You may create traits in subdirectories to organize them as per your need
php artisan make:trait Subdirectory/NameOfYourTrait
trait will be created in the App/Traits/Subdirectory directory and namespaced appropriately.
Arguments
-b or --boot
php artisan make:trait NameOfYourTrait -b MethodName
Creates a trait with a boot method named bootMethodName.
-s or --scope
php artisan make:trait NameOfYourTrait -s MethodName
Creates a trait with a scope method named scopeMethodName.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email developer.tech.dev@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.