Define the application's command schedule.

@return void
429097
protected function defineConsoleSchedule()
    {
        Zilf::$container->register(Schedule::class,function (){
            return new Schedule();
        });

        $schedule = Zilf::$container->getShare(Schedule::class);

        $this->schedule($schedule);
    }
349710
public function cmdUpdateRole()
    {
        $params = $this->getParam();

        if (empty($params[0]) || count($params) < 2) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        if (!is_numeric($params[0])) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $this->setSubmitted(null, $params);
        $this->setSubmittedList('permissions');
        $this->setSubmitted('update', $params[0]);

        $this->validateComponent('user_role');

        $this->updateRole($params[0]);
        $this->output();
    }
106994
protected function defineConsoleSchedule()
    {
        $this->app->singleton(Schedule::class, function ($app) {
            return new Schedule();
        });

        $schedule = $this->app->make(Schedule::class);

        $this->schedule($schedule);
    }
1681
public function handle()
    {
        $events = $this->schedule->dueEvents($this->container);

        foreach ($events as $event) {
            $this->line('<info>Running scheduled command:</info> ' .$event->getSummaryForDisplay());

            $event->run($this->container);
        }

        if (count($events) === 0) {
            $this->info('No scheduled commands are ready to run.');
        }
    }
422690
public function scheduleWork()
    {
        if (is_null($this->scheduler)) {
            return;
        }

        $this->scheduler->reconnect();

        foreach ($this->scheduler->getJobsFor(new \DateTime()) as $job) {
            $this->pipeline->enqueue($job);
        }
    }
952552
protected function doExecute()
	{
		$args = $this->input->args;

		$command = $this->getDescribedCommand($args);

		if (!$command->getApplication())
		{
			$command->setApplication($this->application);
		}

		$descriptor = $this->getDescriptor();

		/** @var $command Command */
		$rendered = $descriptor->describe($command);

		$this->out($rendered);

		return;
	}
478608
public function fire()
	{
		$events = $this->schedule->dueEvents();

		$eventsRan = 0;

		foreach ( $events as $event )
		{
			if ( !$event->filtersPass( $this->laravel ) )
				continue;

			$this->line( '<info>Running scheduled command:</info> ' . $event->getSummaryForDisplay() );

			$event->run( $this->laravel );

			++$eventsRan;
		}

		if ( count( $events ) === 0 || $eventsRan === 0 )
			$this->info( 'No scheduled commands are ready to run.' );
	}
1296915
public function run()
    {

        // Check if we have the schedules, else,
        // insert them
        foreach ($this->schedule as $job) {

            if (! DB::table('schedules')->where('command', $job['command'])->first())
                DB::table('schedules')->insert($job);
        }
    }
972153
public function registerCommands()
    {
        if (! $this->app->runningInConsole()) {
            return;
        }

        foreach ($this->commands as $command) {
            $this->commands($command);
        }
    }
1275974
protected function registerCommands()
    {
        if ($this->app->runningInConsole()) {
            $this->commands([
                ModulesCommand::class,
                ModelsCommand::class,
                EnumsCommand::class,
                RequestsCommand::class,
                MakeModuleCommand::class,
                VersionCommand::class
            ]);
        }
    }
731262
protected function commands()
    {
        $commands = $this->app['config']->get('mount.commands', []);
        if ($commands) {
            Artisan::starting(function ($artisan) use ($commands) {
                $artisan->resolveCommands($commands);
            });
        }
    }
204899
protected function doExecute()
    {
        $args = $this->io->getArguments();

        if (!$this->console instanceof ScheduleConsoleInterface) {
            $this->out('Console Application should be ' . ScheduleConsoleInterface::class);

            return true;
        }

        $schedule = $this->console->make(Schedule::class);

        $this->console->schedule($schedule);

        foreach ($schedule->getDueEvents() as $event) {
            $event->execute();
        }

        return true;
    }
709662
protected function runScheduledEvents()
    {
        foreach ($this->schedule->dueEvents($this->laravel) as $event) {
            $event = $this->convertEvent($event);

            if ($this->canAccessFiltersPass($event) && (! $event->filtersPass($this->laravel))) {
                continue;
            }

            if ($event->onOneServer) {
                $this->runSingleServerEvent($event);
            } else {
                $this->runEvent($event);
            }
        }
    }
38256
public function handle(DeleteScheduleCommand $command)
    {
        $schedule = $command->schedule;

        event(new ScheduleWasRemovedEvent($this->auth->user(), $schedule));

        $schedule->delete();
    }
996868
public function listCommands()
    {
        $commands = $this->library->getAll();

        foreach ($commands as $name => $details) {
            $this->output->writeln(ucwords($name));
            $this->output->hr(strlen($details['description']), '-');
            $this->output->writeln($details['description']);
            $this->output->hr(strlen($details['description']), '-');

            foreach ($details['actions'] as $action) {
                $this->output->writeln(
                    sprintf(
                        "%s - php [file] %s%s [params]",
                        $action,
                        $name,
                        ($action != 'main' ? ":$action" : '')
                    )
                );
            }

            // Just for padding
            $this->output->writeln('');
        }
    }
280463
protected function configure()
    {
        parent::configure();

        $this
            ->setName('run_jobs')
            ->setDescription('Run jobs that are next in line for up to N seconds')
            ->addOption(
                'seconds',
                's',
                InputOption::VALUE_REQUIRED,
                'Run jobs for -s seconds before quitting the process',
                50
            )
            ->addOption(
                'channels',
                'c',
                InputOption::VALUE_REQUIRED,
                'Select one or more channels for jobs for process',
                QueueInterface::MAIN_CHANNEL
            )
            ->addOption(
                'jobs-per-batch',
                '',
                InputOption::VALUE_REQUIRED,
                'Number of jobs that should be fetched and executed per single run',
                1
            );
    }
854368
public function getScheduledCommands()
    {
        $scheduledCommands = [];
        foreach ($this->console->all() as $command) {
            if ($command instanceof ScheduledCommandInterface) {
                $scheduledCommands[] = $command;
            }
        }

        return $scheduledCommands;
    }