Skip to content

Commit

Permalink
Use singleton during Schedule creation to allow "resolving" callbacks (
Browse files Browse the repository at this point in the history
…#20933)

* Use singleton during Schedule creation to allow "resolving" callbacks

* Update Kernel.php
  • Loading branch information
aik099 authored and taylorotwell committed Sep 2, 2017
1 parent fd9319f commit 58c179b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Illuminate/Foundation/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ public function __construct(Application $app, Dispatcher $events)
*/
protected function defineConsoleSchedule()
{
$this->app->instance(Schedule::class, $schedule = new Schedule());
$this->app->singleton(Schedule::class, function ($app) {
return new Schedule;
});

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

$this->schedule($schedule);
}
Expand Down

0 comments on commit 58c179b

Please sign in to comment.