mattostromhall/laravel-make-in

A wrapper around the artisan make command to move created classes to a specified path and update the namespace accordingly.

v0.1.0 2022-02-21 15:44 UTC

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A wrapper around the artisan make command to move created classes to a specified path and update the namespace accordingly. This is not needed if you follow the default folder structure of a laravel project as the make command itself provides this in the name argument of the command.

However, if for instance you are following a Domain Driven approach, this saves you manually moving the files and updating namespaces after creation.

Installation

You can install the package via composer:

composer require --dev mattostromhall/laravel-make-in

Usage

The commands currently available are

php artisan make:command-in
php artisan make:controller-in
php artisan make:job-in
php artisan make:mail-in
php artisan make:model-in
php artisan make:request-in

The base path and namespace for a command can be set through your .env file by adding the following, with values for the base path and namespace you'd like to use for the command:

PATH_BASE_{CLASS_NAME}=path/to/base/location
NAMESPACE_BASE_{CLASS_NAME}=Base\Namespace\Here

Alternatively you can publish the config file and set the values you require there with:

php artisan vendor:publish --tag="laravel-make-in-config"

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.