/** * Write the migration file to disk. * * @param string $name * @param string $table * @param bool $create * @param null $addon * @return string */ protected function writeMigration($name, $table, $create, $addon = null) { $name = $this->dispatch(new GetMigrationName($name, $addon)); if (!($path = $this->dispatch(new CreateAddonMigrationFolder($addon)))) { $path = $this->getMigrationPath(); } $file = pathinfo($this->creator->setCommand($this)->create($name, $path, $table, $create), PATHINFO_FILENAME); $this->line("<info>Created Migration:</info> {$file}"); }
/** * Get an improved stream stub file with more power, yayy! * * @param string $table * @param bool $create * * @return string */ protected function getStub($table, $create) { $path = __DIR__ . '/../../../resources/stubs/database/migrations'; if ($this->input->getOption('fields') && $this->input->getOption('stream')) { return $this->files->get("{$path}/fields.stub"); } if ($this->input->getOption('stream')) { return $this->files->get("{$path}/stream.stub"); } return parent::getStub($table, $create); }
/** * Execute the console command. */ public function fire() { $this->dispatch(new ConfigureCreator($this, $this->input, $this->creator)); $this->creator->setInput($this->input); parent::fire(); }