Rukhsar / laravel-traitcommand by Rukhsar

A laravel artisan command to generate trait quickly.
372
1
2
Package Data
Maintainer Username: Rukhsar
Maintainer Contact: rukhsar.man@gmail.com (Rukhsar Manzoor)
Package Create Date: 2016-11-27
Package Last Update: 2016-12-10
Language: PHP
License: MIT
Last Refreshed: 2024-05-08 03:06:25
Package Statistics
Total Downloads: 372
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 1
Total Open Issues: 0

Laravel Trait Command

A laravel artisan command to generate trait quickly.

Install

Via Composer

composer require rukhsar/traitcommand

In your config/app.php file, add the following to the providers array:

Rukhsar\TraitCommand\TraitCommandServiceProvider::class,

Usage

Once installed, you should see make:trait as one of the artisan commands when you run:

php artisan list

To use this command, supply it with two arguments, the first is the name of the trait, and the second is the name of the folder you want it to reside in. If the folder does not exist, it will be created for you. If you leave second argument empty, trait will be created under app/

For example:

php artisan make:trait ModelTrait Traits

This would create a directory named Traits in your app directory with a php file named ModelTrait.php.