public function schedule(Container $laravel, Kernel $kernel, Schedule $schedule)
    {
        $events = $schedule->dueEvents($laravel);
        $eventsRan = 0;
        $messages = [];

        foreach ($events as $event) {
            if (method_exists($event, 'filtersPass') && (new \ReflectionMethod($event, 'filtersPass'))->isPublic() && ! $event->filtersPass($laravel)) {
                continue;
            }

            $messages[] = 'Running: '.$event->getSummaryForDisplay();

            $event->run($laravel);

            ++$eventsRan;
        }

        if (count($events) === 0 || $eventsRan === 0) {
            $messages[] = 'No scheduled commands are ready to run.';
        }

        return $this->response($messages);
    }
public function schedule(Container $laravel, Kernel $kernel, Schedule $schedule)
    {
        $events = $schedule->dueEvents($laravel);
        $eventsRan = 0;
        $messages = [];

        foreach ($events as $event) {
            if (method_exists($event, 'filtersPass') && (new \ReflectionMethod($event, 'filtersPass'))->isPublic() && ! $event->filtersPass($laravel)) {
                continue;
            }

            $messages[] = 'Running: '.$event->getSummaryForDisplay();

            $event->run($laravel);

            ++$eventsRan;
        }

        if (count($events) === 0 || $eventsRan === 0) {
            $messages[] = 'No scheduled commands are ready to run.';
        }

        return $this->response($messages);
    }
public function schedule ( Container $ laravel , Kernel $ kernel , Schedule $ schedule ) { $ events = $ schedule -> dueEvents ( $ laravel ) ; $ eventsRan = 0 ; $ messages = [ ] ; foreach ( $ events as $ event ) { if ( method_exists ( $ event , 'filtersPass' ) && ( new \ ReflectionMethod ( $ event , 'filtersPass' ) ) -> isPublic ( ) && ! $ event -> filtersPass ( $ laravel ) ) { continue ; } $ messages [ ] = 'Running: ' . $ event -> getSummaryForDisplay ( ) ; $ event -> run ( $ laravel ) ; ++ $ eventsRan ; } if ( count ( $ events ) === 0 || $ eventsRan === 0 ) { $ messages [ ] = 'No scheduled commands are ready to run.' ; } return $ this -> response ( $ messages ) ; }
This method is nearly identical to ScheduleRunCommand shipped with Laravel, but since we are not interested
in console output we couldn't reuse it

@param Container $laravel
@param Kernel $kernel
@param Schedule $schedule
@return array
This method is nearly identical to ScheduleRunCommand shipped with Laravel but since we are not interested in console output we couldn t reuse it