djlimix / laravel-extended-commands
A simple package to add more Make: commands to Laravel.
Requires
- php: ^8.1
- laravel/framework: ^8.0|^9.0|^10.0
Requires (Dev)
- laravel/pint: dev-main
- phpstan/phpstan: 1.9.x-dev
README
This is a simple package used to add more make:*
commands.
Right now, it adds these commands:
- make:interface
- make:service
- make:trait
All files generated by the commands are stored in App/Type
, so for example, trait files are stored in App/Traits
with the same namespace.
Installation
You should install this as a dev dependency:
composer require djlimix/laravel-extended-commands --dev
Command structure
Making an interface
php artisan make:interface InterfaceName
This generates a file called InterfaceName.php
with the namespace of App\Interfaces
inside the folder app\Interfaces
.
Making a service
php artisan make:service ServiceName
This generates a file called ServiceName.php
with the namespace of App\Services
inside the folder app\Services
.
Making a trait
php artisan make:trait TraitName
This generates a file called TraitName.php
with the namespace of App\Traits
inside the folder app\Traits
.
Using a slash in the name of interface/service/trait creates the file in a subfolder, for example:
php artisan make:trait User/CreateUserTrait
creates a trait named CreateUserTrail
inside the folder app\Traits\User
with the namespace of app\Traits\User
Requirements
This package requires Laravel 8 or higher.
Contributing
Contributing is always welcome.