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

[BUG] Commands no longer overwrite default Laravel Scout commands #160

Closed
serpentblade opened this issue Apr 17, 2021 · 1 comment · Fixed by #174
Closed

[BUG] Commands no longer overwrite default Laravel Scout commands #160

serpentblade opened this issue Apr 17, 2021 · 1 comment · Fixed by #174
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@serpentblade
Copy link

Describe the bug
A recent change in Laravel Scout v8.6.1 moved commands to be registered during boot():
laravel/scout#453

This causes the default scout:import to be used rather than this service, regardless of the order of ServiceProviders.

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade to Laravel Scout v8.6.1
  2. Run command php artisan scout:import 'App\YourModel'
  3. Artisan will run the default import command instead of this package's command

Expected behavior
This service should override the scout:import command

Additional context
I believe a simple fix should be move to move the call to registerCommands() inside of boot() instead of register(), however I don't know what the impact would be to versions of Scout prior to v8.6.1. My guess is it would be okay as boot() always occurs after register() so it would still properly override. Some testing against different versions of v8 may be required or upping the minimum version dependency to laravel\scout ^8.6.1.

Version
Versions of Laravel, Scout, and the package.

@serpentblade serpentblade added the bug Something isn't working label Apr 17, 2021
@matchish matchish added the help wanted Extra attention is needed label Apr 18, 2021
@matchish
Copy link
Owner

matchish commented Apr 19, 2021

My guess is it would be okay as boot() always occurs after register() so it would still properly override.

Agree

mstralka added a commit to mobilelocker/laravel-scout-elasticsearch that referenced this issue Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants