@@ -109,9 +109,7 @@ public function dispatchNow($command, $handler = null)
109109    {
110110        $ usesclass_uses_recursive ($ command
111111
112-         if  (in_array (InteractsWithQueue::class, $ uses
113-             in_array (Queueable::class, $ uses
114-             ! $ commandjob ) {
112+         if  (isset ($ uses$ uses$ commandjob ) {
115113            $ commandsetJob (new  SyncJob ($ this container , json_encode ([]), 'sync ' , 'sync ' ));
116114        }
117115
@@ -217,7 +215,7 @@ public function dispatchToQueue($command)
217215    {
218216        $ connection$ commandconnection  ?? null ;
219217
220-         $ queuecall_user_func ($ this queueResolver ,  $ connection
218+         $ queue$ this queueResolver )( $ connection
221219
222220        if  (! $ queueinstanceof  Queue) {
223221            throw  new  RuntimeException ('Queue resolver did not return a Queue implementation. ' );
@@ -239,19 +237,11 @@ public function dispatchToQueue($command)
239237     */ 
240238    protected  function  pushCommandToQueue ($ queue$ command
241239    {
242-         if  (isset ($ commandqueue , $ commanddelay )) {
243-             return  $ queuelaterOn ($ commandqueue , $ commanddelay , $ command
244-         }
245- 
246-         if  (isset ($ commandqueue )) {
247-             return  $ queuepushOn ($ commandqueue , $ command
248-         }
249- 
250240        if  (isset ($ commanddelay )) {
251-             return  $ queuelater ($ commanddelay , $ command
241+             return  $ queuelater ($ commanddelay , $ command, queue:  $ command -> queue  ??  null );
252242        }
253243
254-         return  $ queuepush ($ command
244+         return  $ queuepush ($ command, queue:  $ command -> queue  ??  null );
255245    }
256246
257247    /** 
0 commit comments