| 1 | <?php namespace Serverfireteam\Panel\Commands; |
||
| 6 | class CreateModelCommand extends GeneratorCommand { |
||
| 7 | |||
| 8 | /** |
||
| 9 | * |
||
| 10 | * @var string the console command name |
||
| 11 | */ |
||
| 12 | protected $name = 'panel:createmodel'; |
||
| 13 | |||
| 14 | |||
| 15 | |||
| 16 | /** |
||
| 17 | * |
||
| 18 | * @var string the console command dscription |
||
| 19 | */ |
||
| 20 | protected $description = 'Create a new Controller model class'; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * The type of class being generated. |
||
| 24 | * |
||
| 25 | * @var string indicates the type which used for GeneratorCommand |
||
| 26 | */ |
||
| 27 | protected $type = 'Model'; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Get the stub file for the generator. |
||
| 31 | * |
||
| 32 | * @return string |
||
| 33 | */ |
||
| 34 | protected function getStub() |
||
| 38 | /** |
||
| 39 | * fire model and observer model class |
||
| 40 | * @return void |
||
| 41 | */ |
||
| 42 | public function handle() |
||
| 43 | { |
||
| 44 | parent::handle(); |
||
| 45 | |||
| 46 | $this->call('panel:createobserver', ['name' => $this->argument('name')]); |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Get the default namespace for the class. |
||
| 51 | * |
||
| 52 | * @param string $rootNamespace |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | protected function getDefaultNamespace($rootNamespace) |
||
| 64 | |||
| 65 | } |
||
| 66 |