Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some generator commands don't use custom stubs #37389

Closed
Radiergummi opened this issue May 17, 2021 · 2 comments
Closed

Some generator commands don't use custom stubs #37389

Radiergummi opened this issue May 17, 2021 · 2 comments

Comments

@Radiergummi
Copy link

  • Laravel Version: 8.37.0
  • PHP Version: 8.0.5
  • Database Driver & Version: --

Description:

Using artisan stub:publish, you can publish the stubs used by the various make:* commands of the framework. Some commands, however, ignore custom stubs, and none are published for them either.
This seems to be an oversight: We should be able to use a custom stub for those classes, too.

Commands disregarding custom stubs

Steps To Reproduce:

  1. Execute php artisan stub:publish
  2. Notice the lack of eg. ./stubs/notification.stub and ./stubs/markdown-notification.stub
  3. Create notification.stub manually: touch ./stubs/notification.stub
  4. Create a notification using artisan: php artisan make:notification
  5. A notification is created using the default stub at src/Illuminate/Foundation/Console/stubs/notification.stub

These steps may be repeated with any of the commands listed above.

I'll gladly submit a PR, unless this behavior is intentional for some reason. In general, I believe the resolveStubPath method employed by some make commands should be moved into GeneratorCommand, so all generators may resolve stubs uniformly.

@driesvints
Copy link
Member

This seems like a feature request. Feel free to submit a PR. Please be aware that some stubs have been rejected in the past. Search for these PR's before submitting. Thanks

@Radiergummi
Copy link
Author

@driesvints I'd rather consider it inconsistent and undocumented behavior of the framework, but I'll go with the flow. PR incoming soon. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants