Ejemplo n.º 1
0
 /**
  * Execute the console command.
  */
 public function fire()
 {
     $this->call('config:clear');
     $config = $this->getFreshConfiguration();
     $this->files->put($this->app->getPath('build') . 'config.php', '<?php return ' . var_export($config, true) . ';' . PHP_EOL);
     $this->info('Configuration cached successfully!');
 }
Ejemplo n.º 2
0
 /**
  * Create a new migration at the given path.
  *
  * @param string $name
  * @param string $path
  * @param string $table
  * @param null   $stub
  *
  * @throws \Exception
  *
  * @return string
  */
 public function create($name, $path, $table = null, $stub = null, $replace = [])
 {
     $this->ensureMigrationDoesntAlreadyExist($name);
     $path = $this->getPath($name, $path);
     // First we will get the stub file for the migration, which serves as a type
     // of template for the migration. Once we have those we will populate the
     // various place-holders, save the file, and run the post create event.
     $stub = $this->getStub($table, $stub);
     foreach ($replace as $key => $value) {
         $stub = str_replace('//' . $key . '//', $value, $stub);
     }
     $this->files->put($path, $this->populateStub($name, $stub, $table));
     $this->firePostCreateHooks();
     return $path;
 }