src/Jobs/ArtisanCommand.php
public function handle()
    {
        Log::debug("ArtisanCommand handle begin $this->command_string");

        $input = new StringInput($this->command_string);
        $output = new PusherChannelOutput();

        // init pusher
        $pusher = Broadcast::connection()->getPusher();
        $channel_id = config('platformadmin.console.pusher_channel_base').$this->command_id;
        $output->setPusherConnectionAndChannel($pusher, $channel_id);

        // begin pushing updates
        $output->open();

        // handle the artisan command
        $kernel = app(Kernel::class);
        $status = $kernel->handle($input, $output);
        $kernel->terminate($input, $status);

        // delay a bit to make sure the front-end loaded
        usleep(350000);
        $output->writeln('');

        // wait a little longer and send the final output to pusher
        usleep(750000);
        $output->close($status);

        Log::debug("ArtisanCommand handle end $this->command_string");
    }
public function handle()
    {
        Log::debug("ArtisanCommand handle begin $this->command_string");

        $input = new StringInput($this->command_string);
        $output = new PusherChannelOutput();

        // init pusher
        $pusher = Broadcast::connection()->getPusher();
        $channel_id = config('platformadmin.console.pusher_channel_base').$this->command_id;
        $output->setPusherConnectionAndChannel($pusher, $channel_id);

        // begin pushing updates
        $output->open();

        // handle the artisan command
        $kernel = app(Kernel::class);
        $status = $kernel->handle($input, $output);
        $kernel->terminate($input, $status);

        // delay a bit to make sure the front-end loaded
        usleep(350000);
        $output->writeln('');

        // wait a little longer and send the final output to pusher
        usleep(750000);
        $output->close($status);

        Log::debug("ArtisanCommand handle end $this->command_string");
    }
public function handle ( ) { Log :: debug ( "ArtisanCommand handle begin $this->command_string" ) ; $ input = new StringInput ( $ this -> command_string ) ; $ output = new PusherChannelOutput ( ) ; // init pusher $ pusher = Broadcast :: connection ( ) -> getPusher ( ) ; $ channel_id = config ( 'platformadmin.console.pusher_channel_base' ) . $ this -> command_id ; $ output -> setPusherConnectionAndChannel ( $ pusher , $ channel_id ) ; // begin pushing updates $ output -> open ( ) ; // handle the artisan command $ kernel = app ( Kernel :: class ) ; $ status = $ kernel -> handle ( $ input , $ output ) ; $ kernel -> terminate ( $ input , $ status ) ; // delay a bit to make sure the front-end loaded usleep ( 350000 ) ; $ output -> writeln ( '' ) ; // wait a little longer and send the final output to pusher usleep ( 750000 ) ; $ output -> close ( $ status ) ; Log :: debug ( "ArtisanCommand handle end $this->command_string" ) ; }
handle the job
handle the job