Repository navigation
Sync Laravel Scout index settings in the Laravel automations - #757
Open
jaydrogers wants to merge 1 commit into
Open
jaydrogers wants to merge 1 commit into
jaydrogers wants to merge 1 commit into
Conversation
Member
Author
|
Hey @danpastori (and community 🤓) I'd love to get your blessing on my work here. Let me know if you like this approach |
jaydrogers
marked this pull request as ready for review
November 24, 2026 21:05
Contributor
Images for PR #757
No images were published from this run. View the run for details. All images with sizesSizes are compressed, per architecture.
Updated on every push to this PR. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Laravel automations now run
php artisan scout:sync-index-settingson start, right afteroptimize.The problem
Say your app scopes every search by team. You add
team_idtofilterableAttributesinconfig/scout.phpand deploy.Every search now fails with
Attribute 'team_id' is not filterable. Meilisearch doesn't read your config. It only knows the settings you last pushed, so search stays broken until someone runs the command by hand.It's the same problem
migratesolves: the settings need to ship with the code.It stays out of the way
It's on by default, so it has to be quiet for everyone else:
databaseorcollectiondriverindex-settingsTurn it off with
AUTORUN_LARAVEL_SCOUT_SYNC_INDEX_SETTINGS=false.Where to look for reviewing
lib/laravel/scout-has-index-settings.phpmakes the skip decision. It runs Scout's own checks first, because the command prints a red error on every start for drivers that can't sync.lib/laravel/bootstrap.phpis the boot code fromtest-db-connection.php, moved so both helpers share it.Try it
Swap your image for the PR build in any app that uses Scout:
Then check what it did:
docker compose logs phpindex-settings🔎 Syncing Scout index settingsand Scout's "synced successfully"databasedriverAUTORUN_DEBUG=trueand you'll see the reason📖 Read the new docs section