/**
  * @param Generator  $generator
  * @param Filesystem  $file
  * @param TemplateCompiler  $compiler
  * @param Config  $config
  */
 public function __construct(Generator $generator, Filesystem $file, TemplateCompiler $compiler, Config $config)
 {
     $this->file = $file;
     $this->compiler = $compiler;
     $this->config = $config;
     parent::__construct($generator);
 }
 /**
  * Create directory tree for views, and fire the generator.
  */
 public function fire()
 {
     $directoryPath = dirname($this->getFileGenerationPath());
     if (!File::exists($directoryPath)) {
         File::makeDirectory($directoryPath, 0777, true);
     }
     parent::fire();
 }
 /**
  * Execute the console command.
  */
 public function fire()
 {
     parent::fire();
     // We'll run dump-autoload to refresh everything.
     if (!$this->option('testing')) {
         $this->call('dump-autoload');
     }
 }
 /**
  * Execute the console command
  */
 public function fire()
 {
     parent::fire();
     // Now that the file has been generated,
     // let's run dump-autoload to refresh everything
     if (!$this->option('testing')) {
         $this->call('dump-autoload');
     }
 }
 /**
  * Generate Migrations
  *
  * @param  string $method Create Tables or Foreign Keys ['create', 'foreign_keys']
  * @param  array  $tables List of tables to create migrations for
  * @throws MethodNotFoundException
  * @return void
  */
 protected function generate($method, $tables)
 {
     if ($method == 'create') {
         $function = 'getFields';
         $prefix = 'create';
     } elseif ($method = 'foreign_keys') {
         $function = 'getForeignKeyConstraints';
         $prefix = 'add_foreign_keys_to';
         $method = 'table';
     } else {
         throw new MethodNotFoundException($method);
     }
     foreach ($tables as $table) {
         $this->migrationName = $prefix . '_' . $table . '_table';
         $this->method = $method;
         $this->table = $table;
         $this->fields = $this->schemaGenerator->{$function}($table);
         if ($this->fields) {
             parent::fire();
             if ($this->log) {
                 $file = $this->datePrefix . '_' . $this->migrationName;
                 $this->repository->log($file, $this->batch);
             }
         }
     }
 }