PHPackages                             ajayexpert/artisan-trait-maker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. ajayexpert/artisan-trait-maker

ActiveLibrary[CLI &amp; Console](/categories/cli)

ajayexpert/artisan-trait-maker
==============================

Artisan Command To Create A trait Stub

v1.0.3(8y ago)035MITPHPPHP &gt;=5.3.0

Since Sep 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ajayexpert/artisan-trait-maker)[ Packagist](https://packagist.org/packages/ajayexpert/artisan-trait-maker)[ Docs](https://github.com/ajayexpert/artisan-trait-maker)[ RSS](/packages/ajayexpert-artisan-trait-maker/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

TraitMaker
==========

[](#traitmaker)

[![Latest Version on Packagist](https://camo.githubusercontent.com/86a6967d4132eacad6e7ff5256122af38e03243c97b22b6544d21adfb5510b9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616a61796578706572742f6172746973616e2d74726169742d6d616b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ajayexpert/artisan-trait-maker)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/a4f5d2179c3f0f0a84afb1b5548e047879c83f93a1108eae86b7b7e8a8a4e889/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616a61796578706572742f6172746973616e2d74726169742d6d616b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ajayexpert/artisan-trait-maker/stats)

TraitMaker creates an artisan command that lets you quickly create a trait folder and trait stub. If the folder already exists, you can use the command to place new traits in the exsiting folder.

Install
-------

[](#install)

Via Composer

```
composer require ajayexpert/artisan-trait-maker

```

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

```
AjayExpert\TraitMaker\TraitMakerServiceProvider::class,

```

Usage
-----

[](#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 being the name of the trait, and the second being the name of the folder you want it to reside in. If the folder does not exist, it will be created for you.

For example:

```
php artisan make:trait TestTrait

```

This would create a directory named Traits in your app directory with a php file named TestTrait.php, which would contain the following stub:

```
