Created
November 17, 2015 07:17
-
-
Save cod3beat/a2bb0137c7900cb8f61e to your computer and use it in GitHub Desktop.
Menjalankan Command di luar controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Dicoding\ApplicationService\Administration\NotifyPendingTaskCommand; | |
use Illuminate\Console\Command; | |
class DailyTaskNotifier extends Command | |
{ | |
// code lain disembunyikan agar contoh ini menjadi lebih ringkas | |
public function fire() | |
{ | |
try { | |
$commandBus = App::make('Laracasts\Commander\CommandBus'); | |
$commandBus->execute(new NotifyPendingTaskCommand()); | |
} catch (Exception $ex) { | |
Log::error($ex); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment