| 1 | <?php |
||
| 8 | class DumpCommand extends Command |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The console command name. |
||
| 12 | * |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $name = 'module:dump'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The console command description. |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | protected $description = 'Dump-autoload the specified module or for all module.'; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Execute the console command. |
||
| 26 | * |
||
| 27 | * @return mixed |
||
| 28 | */ |
||
| 29 | public function fire() |
||
| 30 | { |
||
| 31 | $this->info('Generating optimized autoload modules.'); |
||
| 32 | |||
| 33 | if ($module = $this->argument('module')) { |
||
| 34 | $this->dump($module); |
||
| 35 | } else { |
||
| 36 | foreach ($this->laravel['modules']->all() as $module) { |
||
| 37 | $this->dump($module->getStudlyName()); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | public function dump($module) |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Get the console command arguments. |
||
| 55 | * |
||
| 56 | * @return array |
||
| 57 | */ |
||
| 58 | 43 | protected function getArguments() |
|
| 64 | } |
||
| 65 |