Skip to content

Commit 279543c

Browse files
author
Roshan
committed
refactor(kernel) : remove console kernel and use illuminate console contract to make commands registered through app/console available
1 parent 249d93a commit 279543c

File tree

3 files changed

+7
-24
lines changed

3 files changed

+7
-24
lines changed

src/Console/Kernel.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/Http/Controllers/DashboardController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ class DashboardController extends Controller
1212
public function index()
1313
{
1414
return redirect()->route('totem.tasks.all');
15-
// return view('totem::dashboard');
1615
}
1716
}

src/Http/Controllers/TasksController.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Studio\Totem\Task;
66
use Studio\Totem\Totem;
7-
use Studio\Totem\Console\Kernel;
7+
use Illuminate\Contracts\Console\Kernel;
88
use Studio\Totem\Contracts\TaskInterface;
99
use Studio\Totem\Http\Requests\TaskRequest;
1010

@@ -55,7 +55,9 @@ public function create()
5555
{
5656
return view('totem::tasks.form', [
5757
'task' => new Task,
58-
'commands' => $this->kernel->getCommands(),
58+
'commands' => collect($this->kernel->all())->sortBy(function ($command) {
59+
return $command->getDescription();
60+
}),
5961
'timezones' => timezone_identifiers_list(),
6062
'frequencies' => Totem::frequencies(),
6163
]);
@@ -99,7 +101,9 @@ public function edit($task)
99101
{
100102
return view('totem::tasks.form', [
101103
'task' => $task,
102-
'commands' => $this->kernel->getCommands(),
104+
'commands' => collect($this->kernel->all())->sortBy(function ($command) {
105+
return $command->getDescription();
106+
}),
103107
'timezones' => timezone_identifiers_list(),
104108
'frequencies' => Totem::frequencies(),
105109
]);

0 commit comments

Comments
 (0)