A Laravel Package to make Trait with artisan CLI.
If you like this package you can Buy me a Coffee ☕️
composer require jornatf/laravel-trait-generator
php artisan make:trait Foo
The trait namespace is: App\Traits
.
Trait generated:
<?php
namespace App\Traits;
trait Foo
{
/**
* Method description.
*
* @return string
*/
public function methodName()
{
return "Hello World";
}
}
<?php
namespace App\Http\Controllers;
use App\Traits\Foo;
use App\Http\Controllers\Controller;
class PostController extends Controller
{
use Foo;
// your controller methods HERE.
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Feel free to contribute to this project to improve with new features or fix bugs 👍
The MIT License (MIT).
Please see License File for more information.