framework icon indicating copy to clipboard operation
framework copied to clipboard

[9.x] `make:migration` remove `--fullpath` option

Open davecalnan opened this issue 1 year ago • 0 comments

Background

When using php artisan make:* commands, almost all provide the full relative path to the file in the console output e.g. Model [app/MyModel.php] created successfully. This is great as many terminals support clicking this path and opening it in your editor.

All the default `make` commands provide the full relative path, except for `make:migration`. I've tested each of them listed here.
  • make:cast
  • make:channel
  • make:command
  • make:component
  • make:controller
  • make:event
  • make:exception
  • make:factory
  • make:job
  • make:listener
  • make:mail
  • make:middleware
  • make:model
  • make:notification
  • make:observer
  • make:policy
  • make:provider
  • make:request
  • make:resource
  • make:rule
  • make:scope
  • make:seeder
  • make:test

Looking into it I see a --fullpath option was added to make:migration in #28669. My guess is that maybe Nuno's Artisan improvements added the relative paths and this command was left as is.

Proposed Change

I would like to propose removing the --fullpath option from the make:migration command to bring its default behaviour in line with every other make command.

I think this is the more desirable behaviour - I know I would find it useful to be able to open the migration in my editor without having to remember to provide an option unique to this command.

This small PR implements simply removes that option. See before and after screenshots below.

If needed I could also add a --filename or similar option to opt in to the current behaviour while making the full relative path the default.

Before

CleanShot 2023-01-06 at 08 24 56@2x

After

CleanShot 2023-01-06 at 08 25 08@2x

Granted, this is only a small change so might not be worth it if it's considered a breaking change or upsetting people's workflows. Happy to close in that case. Thanks!

davecalnan avatar Jan 06 '23 08:01 davecalnan