/** * Execute the console command. * * @return void */ public function fire() { $name = $this->argument('name'); $path = $this->getPath(); $fields = $this->option('fields'); $created = $this->generator->parse($name, $fields)->make($path, null); $this->call('dump-autoload'); $this->printResult($created, $path); }
/** * Execute the console command. * * @return void */ public function fire() { $tables = explode(',', $this->argument('tables')); $prefix = \DB::getTablePrefix(); foreach ($tables as $table) { $name = 'create_' . $table . '_table'; $fields = $this->detectColumns($prefix . $table); $path = $this->option('path') . '/' . $name . '.php'; $created = $this->generator->parse($name, $fields)->make($path, null); if ($created) { $this->info("Created migration {$path}"); } else { $this->error("Could not create {$path} with: {$fields}"); } } }