rifrocket/trait-console

Console command to create Traits for the Laravel

3.3 2020-10-26 05:04 UTC

This package is auto-updated.

Last update: 2024-10-26 13:46:53 UTC


README

Latest Version on Packagist Quality Score Total Downloads

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.