Make migration for package
Made a small command for making migration for packages. I then to forge the parameters.
class MakeMigrationForPackage extends Command
{
protected $name = 'make:migration:package';
protected $signature = 'make:migration:package';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Create migration for packages';
public function fire()
{
return $this->handle();
}
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
$package = $this->ask('Migration for package');
$table = $this->ask('Migrations for table');
$name = $this->ask('Describe migration');
$package = ucfirst($package);
$name = str_slug($name);
$name = str_replace('-', '_', $name);
Artisan::call('make:migration', [
'name' => $name,
'--table' => $table,
// depending where you store your pages when developing
'--path' => "packages/moln8-components/{$package}/database/migrations"]);
}
}