MakeModelCommand.php 687 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Console\Commands;
  3. class MakeModelCommand extends \Illuminate\Foundation\Console\ModelMakeCommand
  4. {
  5. protected function getStub()
  6. {
  7. if ($this->option('pivot')) {
  8. return parent::getStub();
  9. }
  10. return __DIR__ . '/stubs/model.stub';
  11. }
  12. public function handle()
  13. {
  14. if (parent::handle() === false && ! $this->option('force')) {
  15. return false;
  16. }
  17. if ($this->option('all')) {
  18. $this->input->setOption('service', true);
  19. }
  20. if ($this->option('service')) {
  21. $this->createService();
  22. }
  23. }
  24. public function createService()
  25. {
  26. }
  27. }