xammie / make-commands
Extended make commands for laravel
Fund package maintenance!
Xammie
Installs: 6 387
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 2
Forks: 0
Open Issues: 2
Requires
- php: ^8.0
- laravel/framework: ^8.0 || ^9.0 || ^10.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- laravel/pint: ^1.2
- nunomaduro/collision: ^5.10 || ^6.0
- nunomaduro/larastan: ^1.0 || ^2.0
- orchestra/testbench: ^6.22 || ^7.0 || ^8.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-12-09 12:43:24 UTC
README
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() { // } }
Installation
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', ], ];
Usage
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
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.