Repository URL to install this package:
|
Version:
1.0.0 ▾
|
<?php
namespace Modules\Themes\Console;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
class ListCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'themes:list';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Show list of all themes.';
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
$this->table(['Name', 'Description', 'Type', 'Path'], $this->getRows());
}
/**
* Get table rows.
*
* @return array
*/
public function getRows()
{
$rows = [];
foreach ($this->getThemes() as $themes) {
$rows[] = [
$themes->getName(),
$themes->getDescription(),
$themes->getType(),
$themes->getPath(),
];
}
return $rows;
}
/**
* @return \Modules\Themes\Theme\Theme[]
*/
public function getThemes()
{
return \Themes::themes();
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return array(
array('only', null, InputOption::VALUE_OPTIONAL, 'Types of modules will be displayed.', null),
array('direction', 'd', InputOption::VALUE_OPTIONAL, 'The direction of ordering.', 'asc'),
);
}
}