Created
March 5, 2015 00:42
-
-
Save rizqidjamaluddin/4dad656104c638398b88 to your computer and use it in GitHub Desktop.
This file contains 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 Illuminate\Console\Command; | |
class AddUncategorizedCategoryCommand extends Command | |
{ | |
protected $name = 'appname:generate:categories'; | |
protected $description = 'Generate default item categories.'; | |
/** | |
* @var ItemCategoriesService | |
*/ | |
private $itemCategoriesService; | |
public function __construct(ItemCategoriesService $itemCategoriesService) | |
{ | |
parent::__construct();; | |
$this->itemCategoriesService = $itemCategoriesService; | |
} | |
public function fire() | |
{ | |
$this->info('Adding default item categories ...'); | |
$this->itemCategoriesService->createNewIfMissing('Uncategorized'); | |
$this->info('Done.'); | |
} | |
protected function getArguments() | |
{ | |
return array(); | |
} | |
protected function getOptions() | |
{ | |
return array(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment