@peanut Not sure what you’re trying to do. Why are you creating migrations in this way?
Oct 24, 2015
3
Level 2
Make migration from code
So I'm trying to create a migration from one of my model's with it's model name (building a CMS so every time they build it, it will create the database fields (if they've changed from the last migration).
This is what I have so far:
$name = $this->getClassName();
$command = $this->artisan('make:migration create_' . strtolower($name) . '_table');
dd($command);
/****** METHOD IN CLASS ********/
/**
* Call artisan method
*/
protected function artisan($command, array $args = [])
{
$process = new Process('cd ' . base_path() . ' && php artisan ' . $command);
return $process->run();
}
My question is after the migration is created, is there a way to edit it within Laravel? Or will I have to do some weird opening of the file, editing the up and down methods?
Thanks for any help!
Please or to participate in this conversation.