mardi 26 décembre 2017

Hook Before/After events in Command Chain - Laravel/Lumen Artisan Scheduler

Suppose I have two Commands (A and B) and had to scheduled them after each other.

$schedule->command('A')->everyMinute()->then(function() {
    $this->call('B')
    ->before(function() {
       Log::info('some event')
    })
    ->after(function() {
      Log::info('some event')
  });
});

Before and After hooks inside then(Closure) not working.

Also tried $schedule variable within the Closure. Fixed that by using 'use' but that also not worked.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2BUyAHA
via IFTTT

Aucun commentaire:

Enregistrer un commentaire