This package extends the default laravel make commands to create classes like actions, services, enums and more.
php artisan make:action CreateUserAction
This will create the file app/Actions/CreateUserAction.php
<?php
namespace App\Actions;
class CreateUserAction
{
public function handle()
{
//
}
}
You can install the package via composer:
composer require --dev xammie/make-commands
You can publish the stubs with:
php artisan vendor:publish --tag="make-commands-stubs"
You can publish the config file with:
php artisan vendor:publish --tag="make-commands-config"
This is the contents of the published config file:
return [
'namespaces' => [
'action' => 'Actions',
'collection' => 'Collections',
'config' => 'config',
'contract' => 'Contracts',
'dto' => 'Dtos',
'enum' => 'Enums',
'interface' => 'Interfaces',
'repository' => 'Repositories',
'service' => 'Services',
'trait' => 'Traits',
],
];
The following commands are available.
php artisan make:action CreateUserAction
php artisan make:collection OrderCollection
php artisan make:config config-file
php artisan make:contract CreatesUserContract
php artisan make:dto RestRequestObject
php artisan make:enum OrderStatusEnum
php artisan make:interface OrderRepositoryInterface
php artisan make:repository OrderRepository
php artisan make:service PaymentService
php artisan make:trait TraitHelper
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.