diff --git a/src/Illuminate/Queue/Connectors/SyncConnector.php b/src/Illuminate/Queue/Connectors/SyncConnector.php index 4269b803927f..5427d3afae5d 100755 --- a/src/Illuminate/Queue/Connectors/SyncConnector.php +++ b/src/Illuminate/Queue/Connectors/SyncConnector.php @@ -14,6 +14,6 @@ class SyncConnector implements ConnectorInterface */ public function connect(array $config) { - return new SyncQueue; + return new SyncQueue($config['after_commit'] ?? null); } } diff --git a/src/Illuminate/Queue/SyncQueue.php b/src/Illuminate/Queue/SyncQueue.php index c687635ee3ea..57974960d4bb 100755 --- a/src/Illuminate/Queue/SyncQueue.php +++ b/src/Illuminate/Queue/SyncQueue.php @@ -12,6 +12,17 @@ class SyncQueue extends Queue implements QueueContract { + /** + * Create a new sync queue instance. + * + * @param bool $dispatchAfterCommit + * @return void + */ + public function __construct($dispatchAfterCommit = false) + { + $this->dispatchAfterCommit = $dispatchAfterCommit; + } + /** * Get the size of the queue. *