diff --git a/config/scout.php b/config/scout.php index e8a3bdda..b823b1e5 100644 --- a/config/scout.php +++ b/config/scout.php @@ -37,12 +37,17 @@ |-------------------------------------------------------------------------- | | This option allows you to control if the operations that sync your data - | with your search engines are queued. When this is set to "true" then - | all automatic data syncing will get queued for better performance. + | with your search engines are queued. When enabled, all automatic data + | syncing will get queued for better performance. You can also specify + | the queue connection and queue name to use. | */ - 'queue' => env('SCOUT_QUEUE', false), + 'queue' => [ + 'enable' => env('SCOUT_QUEUE', false), + 'connection' => env('SCOUT_QUEUE_CONNECTION'), + 'queue' => env('SCOUT_QUEUE_NAME'), + ], /* |-------------------------------------------------------------------------- diff --git a/src/Searchable.php b/src/Searchable.php index e7c64f66..f5517e08 100644 --- a/src/Searchable.php +++ b/src/Searchable.php @@ -67,7 +67,7 @@ public function queueMakeSearchable($models) return; } - if (! config('scout.queue')) { + if (! config('scout.queue.enable')) { return $this->syncMakeSearchable($models); } @@ -103,7 +103,7 @@ public function queueRemoveFromSearch($models) return; } - if (! config('scout.queue')) { + if (! config('scout.queue.enable')) { return $this->syncRemoveFromSearch($models); } diff --git a/tests/Feature/SearchableTest.php b/tests/Feature/SearchableTest.php index f3b63e1a..a91891e6 100644 --- a/tests/Feature/SearchableTest.php +++ b/tests/Feature/SearchableTest.php @@ -59,7 +59,7 @@ public function test_overridden_make_searchable_is_dispatched() { Queue::fake(); - config()->set('scout.queue', true); + config()->set('scout.queue.enable', true); Scout::makeSearchableUsing(OverriddenMakeSearchable::class); $collection = m::mock(); @@ -114,7 +114,7 @@ public function test_overridden_remove_from_search_is_dispatched() { Queue::fake(); - config()->set('scout.queue', true); + config()->set('scout.queue.enable', true); Scout::removeFromSearchUsing(OverriddenRemoveFromSearch::class); $collection = m::mock();