app/Console/Commands/GameExecutor.php
/**
     * Execute the console command.
     *
     * @return mixed
     */
Execute the console command.
@return mixed
Execute the console command . @return mixed
public static function handle()
    {
        while (true) {
            event(new RemainingTimeChanged(self::$time . 's'));
            self::$time--;
            sleep(1);
            if (self::$time === 0) {
                self::$time = 'Waiting to start';
                event(new RemainingTimeChanged(self::$time));
                event(new WinnerNumberGenerated(mt_rand(1, 12)));
                sleep(5);
                self::$time = 15;
            }
        }
    }
public static function handle ( ) { while ( true ) { event ( new RemainingTimeChanged ( self :: $ time . 's' ) ) ; self :: $ time -- ; sleep ( 1 ) ; if ( self :: $ time === 0 ) { self :: $ time = 'Waiting to start' ; event ( new RemainingTimeChanged ( self :: $ time ) ) ; event ( new WinnerNumberGenerated ( mt_rand ( 1 , 12 ) ) ) ; sleep ( 5 ) ; self :: $ time = 15 ; } } }
Execute the console command.
Execute the console command .