Closed tklie closed 2 months ago
Would break all existing apps.
Will be fixed in future versions though? Because as it stands right now, the Searchable
trait is inconsistent within itself, using two different config keys.
To clarify: You can use it as is right now by setting the entire scout.queue
option in your config file to false
. But having the config file like this
return [
'queue' => [
'connection' => env('SCOUT_CONNECTION'),
'queue' => env('SCOUT_QUEUE', false),
],
]
and disabling queueing via an env variable is not possible right now, because scout.queue
will always be truthy since it's an array.
@taylorotwell it would be nice, if we could fix this by adding another options possibly like connection ?
'connection' => env('SCOUT_CONNECTION')
and
public function syncWithSearchUsing()
{
return config('scout.connection') ?: config('queue.default');
}
This PR fixes how the
Searchable
trait determines whether to queue jobs. Also, the published configuration file is updated to be compatible with the current version of the trait.The
Searchable
trait currently determines the queue connection and queue using the following two methods:However, the config file that is published by this package only contained the following config option:
This has been updated to the keys actually used by the trait:
Subsequently, another update to the
Searchable
trait itself was necessary, since this used the oldscout.queue
key to determine if jobs should be queued. It now correctly usesscout.queue.queue
:Edit: The same was done for the
queueRemoveFromSearch
method.