TheDragonCode/laravel-deploy-operations

Add the ability to automatically generate a file name when creating

Closed this issue · 0 comments

Now, when creating a file, you must enter the name yourself to form the file. It would be cool to do it automatically.

How will it look like:

If you don't fill in the name parameter when creating the command, it should automatically generate a name for the file.

As a prefix, can take the current branch name from the repository, if it exists.

For example,

# with git

php artisan make:migration:action

// 2022_01_28_184116_main_1643384476.php
// 2022_01_28_184117_main_1643384477.php
// 2022_01_28_184118_crm_2345_1643384478.php
// 2022_01_28_184119_crm_2345_1643384479.php
# without git

php artisan make:migration:action

// 2022_01_28_184116_auto_1643384476.php
// 2022_01_28_184117_auto_1643384477.php
// 2022_01_28_184118_auto_1643384478.php
// 2022_01_28_184119_auto_1643384479.php
# with name parameter

php artisan make:migration:action FooBar

// 2022_01_28_184116_foo_bar.php
// 2022_01_28_184117_foo_bar.php
// 2022_01_28_184118_foo_bar.php
// 2022_01_28_184119_foo_bar.php

The idea is that if the developer does not need meaningful names, then auto-creation can be applied, leaving only the check of the current active branch in the repository.