Example #1
0
 /**
  * Create the new controller
  *
  * @return void
  */
 protected function makeController()
 {
     $code = $this->compileController();
     $path = $this->getControllerPath();
     $this->files->put($path, $code);
     $this->info('Controller created successfully.');
     $this->composer->dumpAutoloads();
 }
 /**
  * Generate the desired migration.
  */
 protected function makeMigration()
 {
     $name = $this->argument('name');
     if ($this->files->exists($path = $this->getPath($name))) {
         return $this->error($this->type . ' already exists!');
     }
     $this->makeDirectory($path);
     $this->files->put($path, $this->compileMigrationStub());
     $this->info('Migration created successfully.');
     $this->composer->dumpAutoloads();
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $header = "scaffolding: {$this->getObjName("Name")}";
     $footer = str_pad('', strlen($header), '-');
     $dump = str_pad('>DUMP AUTOLOAD<', strlen($header), ' ', STR_PAD_BOTH);
     $this->line("\n----------- {$header} -----------\n");
     $this->makeMeta();
     $this->makeMigration();
     $this->makeSeed();
     $this->makeModel();
     $this->makeController();
     // $this->makeLocalization(); //ToDo - implement in future version
     $this->makeViews();
     $this->makeViewLayout();
     $this->line("\n----------- {$footer} -----------");
     $this->comment("----------- {$dump} -----------");
     $this->composer->dumpAutoloads();
     $this->error("Don't forget to adjust: 'migrate' and 'routes'");
 }