LaravelPackages.net
Acme Inc.
Toggle sidebar
mantey/laratrait

An easy way to create a trait with php artisan command

30
4
v1.2.0
About mantey/laratrait

mantey/laratrait is a Laravel package for an easy way to create a trait with php artisan command. It currently has 4 GitHub stars and 30 downloads on Packagist (latest version v1.2.0). Install it with composer require mantey/laratrait. Discover more Laravel packages by mantey or browse all Laravel packages to compare alternatives.

Last updated

Laratrait

Latest Version on Packagist Software License Total Downloads

Laratrait is an easy way to add traits (trait folder and trait stub) to your laravel projects, using the artisan command php artisan laratrait:trait TraitName

Installation

To install via Composer run the command from your terminal:

$ composer require mantey/laratrait

Usage

The command below should show make:trait as one of the artisan commands after installation.

$ php artisan

To make a trait just run the command below. TraitName, being the name of your trait.

$ php artisan make:trait TraitName

To specify the path for the trait use the option --path and the--func option adds a function to your trait.

$ php artisan make:trait TraitName --path=pathName --func=functionName

To generate traits with multiple functions.

$ php artisan make:trait TraitName --func=foo,bar,foobar

Contributing

Please report any issue you find in the issues page. Pull requests are always welcome.

License

Laratrait is open-sourced software licensed under the MIT license.

Star History Chart