Skip to content

Commit

Permalink
Fixes schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Apr 24, 2024
1 parent 7ef849d commit 050263b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Bootstrap/RegisterProviders.php
Expand Up @@ -13,6 +13,8 @@

namespace LaravelZero\Framework\Bootstrap;

use Illuminate\Console\Scheduling\Schedule;
use LaravelZero\Framework\Kernel as ConsoleKernel;
use Illuminate\Foundation\Bootstrap\RegisterProviders as BaseRegisterProviders;
use LaravelZero\Framework\Application;
use LaravelZero\Framework\Components;
Expand Down Expand Up @@ -78,6 +80,11 @@ public function bootstrap(Application $app): void
$app->make(BaseRegisterProviders::class)
->bootstrap($app);

/*
* Register the console schedule implementation.
*/
$this->registerConsoleSchedule($app);

/*
* Then we register Laravel Zero available providers.
*/
Expand All @@ -95,4 +102,16 @@ function ($serviceProviderClass) use ($app) {
}
);
}


/**
* Register the console schedule implementation.
*/
public function registerConsoleSchedule(Application $app): void
{
$app->singleton(Schedule::class, function ($app) {
return $app->make(ConsoleKernel::class)->resolveConsoleSchedule();
});
}

}

0 comments on commit 050263b

Please sign in to comment.