Skip to content

Commit 050263b

Browse files
committed
Fixes schedule
1 parent 7ef849d commit 050263b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Bootstrap/RegisterProviders.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
namespace LaravelZero\Framework\Bootstrap;
1515

16+
use Illuminate\Console\Scheduling\Schedule;
17+
use LaravelZero\Framework\Kernel as ConsoleKernel;
1618
use Illuminate\Foundation\Bootstrap\RegisterProviders as BaseRegisterProviders;
1719
use LaravelZero\Framework\Application;
1820
use LaravelZero\Framework\Components;
@@ -78,6 +80,11 @@ public function bootstrap(Application $app): void
7880
$app->make(BaseRegisterProviders::class)
7981
->bootstrap($app);
8082

83+
/*
84+
* Register the console schedule implementation.
85+
*/
86+
$this->registerConsoleSchedule($app);
87+
8188
/*
8289
* Then we register Laravel Zero available providers.
8390
*/
@@ -95,4 +102,16 @@ function ($serviceProviderClass) use ($app) {
95102
}
96103
);
97104
}
105+
106+
107+
/**
108+
* Register the console schedule implementation.
109+
*/
110+
public function registerConsoleSchedule(Application $app): void
111+
{
112+
$app->singleton(Schedule::class, function ($app) {
113+
return $app->make(ConsoleKernel::class)->resolveConsoleSchedule();
114+
});
115+
}
116+
98117
}

0 commit comments

Comments
 (0)