/**
  * 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}");
 }