Closed oprypkhantc closed 2 years ago
Hey @oprypkhantc, I would like to keep these two packages isolated, therefore this feature is unlikely to be included in the library. You can create your own command and publish it on GitHub to be able to reuse it in your projects. Thank you for your understanding 🙂
Hey.
Laravel's
migrate
command allows you to run the seeds automatically with--seed
option. This is very convenient for development. It would be nice to have a similar--import
option forelastic:migrate
set of commands, which would run a Scout import of all searchable models after creating the indexes.This is technically achievable in userland code by creating a duplicate set of commands that first call respective commands from this package and then runs the import, however this is obviously not optimal. I believe this is a common enough task for it to be included in the package itself.
Unfortunately there's a caveat: this package doesn't depend on
laravel/scout
, and--import
flag pretty much only makes sense in the context of Laravel Scout.There are possible solutions to this though, like the use of
suggests
section ofcomposer.json
, in a similar way thatlaravel/framework
does it. The whole feature would take a few lines: