/**
  * Execute the command.
  */
 public function fire(Composer $composer)
 {
     $generator = new MigrationGenerator(['name' => $this->argument('name'), 'fields' => $this->option('fields'), 'force' => $this->option('force')]);
     $generator->run();
     $this->info('Migration created successfully.');
     $composer->dumpAutoloads();
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->info('Generating optimized class loader...');
     $this->composer->dumpOptimized();
     $this->info('Compiling common classes...');
     $this->compileClasses();
 }
 /**
  * Execute the command.
  */
 public function fire(Composer $composer)
 {
     $generator = new SeedGenerator(['name' => $this->argument('name'), 'master' => $this->option('master'), 'force' => $this->option('force')]);
     $generator->run();
     $this->info('Seed created successfully.');
     $composer->dumpAutoloads();
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $fullPath = $this->createBaseMigration();
     $this->files->put($fullPath, $this->files->get(__DIR__ . '/stubs/counter.stub'));
     $this->info('Migration created successfully!');
     $this->composer->dumpAutoloads();
 }
 /**
  * Execute the console command.
  */
 public function fire()
 {
     $fullPath = $this->createBaseMigration();
     $this->files->put($fullPath, $this->files->get(__DIR__ . '/stubs/database.stub'));
     $this->info('Migration created successfully!  Don\'t forget to run "artisan migrate".');
     $this->composer->dumpAutoloads();
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->call('optimize');
     foreach ($this->findWorkbenches() as $workbench) {
         $this->comment("Running for workbench [{$workbench['name']}]...");
         $this->composer->setWorkingPath($workbench['path'])->dumpOptimized();
     }
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->setAppDirectoryNamespace();
     $this->setConfigNamespaces();
     $this->setComposerNamespace();
     $this->info('Application namespace set!');
     $this->composer->dumpAutoloads();
 }
Exemple #8
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $table = $this->laravel['config']['queue.connections.database.table'];
     $fullPath = $this->createBaseMigration($table);
     $stub = str_replace('{{table}}', $table, $this->files->get(__DIR__ . '/stubs/jobs.stub'));
     $this->files->put($fullPath, $stub);
     $this->info('Migration created successfully!');
     $this->composer->dumpAutoloads();
 }
 /**
  * Execute the command.
  */
 public function fire(Composer $composer)
 {
     if ($this->argument('name') != null) {
         $this->generateFromCommand();
     } else {
         $this->generateFromDatabase();
     }
     $composer->dumpAutoloads();
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $table = $this->laravel['config']['queue.failed.table'];
     $tableClassName = Str::studly($table);
     $fullPath = $this->createBaseMigration($table);
     $stub = str_replace(['{{table}}', '{{tableClassName}}'], [$table, $tableClassName], $this->files->get(__DIR__ . '/stubs/failed_jobs.stub'));
     $this->files->put($fullPath, $stub);
     $this->info('Migration created successfully!');
     $this->composer->dumpAutoloads();
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $this->meta = (new NameParser())->parse($this->argument('name'));
     $this->buildMigration();
     $this->buildController();
     $this->buildModel();
     $this->buildViews();
     $this->buildRoutes();
     $this->composer->dumpAutoloads();
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->currentRoot = trim($this->getAppNamespace(), '\\');
     $this->setBootstrapNamespaces();
     $this->setAppDirectoryNamespace();
     $this->setConfigNamespaces();
     $this->setComposerNamespace();
     $this->info('Application namespace set!');
     $this->composer->dumpAutoloads();
 }
 /**
  * Generate the desired migration.
  */
 protected function makeMigration()
 {
     $name = $this->argument('name');
     if ($this->files->exists($path = $this->getPath($name))) {
         return $this->error($this->type . ' already exists!');
     }
     $this->makeDirectory($path);
     $this->files->put($path, $this->compileMigrationStub());
     $this->info('Migration created successfully.');
     $this->composer->dumpAutoloads();
 }
Exemple #14
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->info('Generating optimized class loader');
     $this->composer->dumpOptimized();
     if ($this->option('force') or !$this->laravel['config']['app.debug']) {
         $this->info('Compiling common classes');
         $this->compileClasses();
     } else {
         $this->call('clear-compiled');
     }
 }
 /**
  * Generate the desired Model.
  */
 protected function makeModel()
 {
     $name = $this->argument('name');
     if ($this->files->exists($path = $this->getPath($name))) {
         return $this->error($name . ' Model already exists!');
     }
     $this->makeDirectory($path);
     $this->files->put($path, $this->compileAspNetModel());
     $this->info('AspNet Model created successfully.');
     $this->composer->dumpAutoloads();
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $table = $this->input->getArgument('table');
     $column = $this->input->getArgument('column');
     $name = 'add_' . $column . '_to_' . $table . '_table';
     // Now we are ready to write the migration out to disk. Once we've written
     // the migration out, we will dump-autoload for the entire framework to
     // make sure that the migrations are registered by the class loaders.
     $this->writeMigration($name, $table, $column);
     $this->composer->dumpAutoloads();
 }
Exemple #17
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->currentRoot = trim($this->laravel->getNamespace(), '\\');
     $this->setBootstrapNamespaces();
     $this->setAppDirectoryNamespace();
     $this->setConfigNamespaces();
     $this->setComposerNamespace();
     $this->setDatabaseFactoryNamespaces();
     $this->info('Application namespace set!');
     $this->composer->dumpAutoloads();
     $this->call('clear-compiled');
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     // It's possible for the developer to specify the tables to modify in this
     // schema operation. The developer may also specify if this table needs
     // to be freshly created so we can create the appropriate migrations.
     $name = $this->input->getArgument('name');
     $table = $this->input->getOption('table');
     $create = $this->input->getOption('create');
     if (!$table && is_string($create)) {
         $table = $create;
     }
     // Now we are ready to write the migration out to disk. Once we've written
     // the migration out, we will dump-autoload for the entire framework to
     // make sure that the migrations are registered by the class loaders.
     $this->writeMigration($name, $table, $create);
     $this->composer->dumpAutoloads();
 }
Exemple #19
0
 /**
  * Writes migration files to disk.
  *
  * @return void
  */
 protected function writeMigrations()
 {
     $files = $this->migrator->create($this->options);
     foreach ($files as $file) {
         $path = pathinfo($file, PATHINFO_FILENAME);
         $this->line("      <fg=green;options=bold>create</fg=green;options=bold>  {$path}");
     }
     $this->composer->dumpAutoloads();
 }
 /**
  * Setup views and assets
  *
  */
 private function makeViews()
 {
     foreach ($this->views as $view) {
         // index, create, show, edit
         new MakeView($this, $this->files, $view);
     }
     $this->info('Views created successfully.');
     $this->info('Dump-autoload...');
     $this->composer->dumpAutoloads();
     $this->info('Route::resource("' . $this->getObjName("names") . '","' . $this->getObjName("Name") . 'Controller"); // Add this line in routes.php');
 }
 /**
  * Generate the desired Validation.
  */
 protected function makeValidation()
 {
     $name = $this->argument('name');
     if ($this->files->exists($path = $this->getPath($name))) {
         return $this->error($name . ' Validation already exists!');
     }
     $this->makeDirectory($path);
     $this->files->put($path, $this->compileAspNetValidation());
     $this->info('AspNet Unobtrusive Validation created successfully.');
     $this->makeLoader();
     $this->composer->dumpAutoloads();
 }
 /**
  * Generate the desired repository.
  */
 protected function makeRepository()
 {
     foreach ($this->meta['paths'] as $key => $path) {
         if ($this->files->exists($path)) {
             return $this->error($this->meta['names'][$key] . ' already exists!');
         }
     }
     $this->makeDirectory($path);
     $this->makeContract();
     $this->makeEloquent();
     $this->makeModel();
     $this->composer->dumpAutoloads();
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $tabs = '            ';
     $oldMigrations = File::glob($this->getMigrationPath() . '/*_create_ct_*_table.php');
     File::delete($oldMigrations);
     $files = File::allFiles(base_path('.wk/ct_tables'));
     foreach ($files as $file) {
         $table = 'ct_' . snake_case($file->getBaseName('.' . $file->getExtension()));
         if ($table == 'ct_list') {
             $table = 'ct_wine_list';
         }
         $name = "create_{$table}_table";
         $create = $table;
         $migration = $this->writeMigration($name, $table, $create);
         $fields = File::get($file);
         $fields = explode(PHP_EOL, $fields);
         $indexes = [];
         $fields = array_map(function ($field) use(&$indexes) {
             @(list($field, $type, $params) = explode(':', trim($field)));
             $type = $type ?: 'string';
             $params = $params ? ', ' . str_replace(',', ', ', $params) : null;
             $indexes[] = $field;
             return '$table->' . $type . '(\'' . snake_case($field) . '\'' . $params . ')->nullable();';
         }, $fields);
         $migration = $this->getMigrationPath() . '/' . $migration . '.php';
         $contents = File::get($migration);
         $indexes = Downloader::findIndexes($indexes);
         $lines = ['$table->increments(\'id\');', '$table->unsignedInteger(\'user_id\');', implode(PHP_EOL . $tabs, $fields), '$table->softDeletes();'];
         if (count($indexes)) {
             $lines[] = '$table->unique([\'user_id\', \'' . implode('\', \'', $indexes) . '\']);';
         }
         $contents = str_replace('$table->increments(\'id\');', implode(PHP_EOL . $tabs, $lines), $contents);
         File::put($migration, $contents);
     }
     $this->composer->dumpAutoloads();
 }
 /**
  * Execute the command.
  *
  * @param  Composer $composer
  *
  * @throws FileAlreadyExistsException
  */
 public function handle(Composer $composer)
 {
     $this->generator->setConsole($this)->setOptions(['name' => $this->argument('name'), 'master' => $this->option('master'), 'force' => $this->option('force')])->run();
     $this->info('Seed created successfully.');
     $composer->dumpAutoloads();
 }
 protected function dumpAutoload()
 {
     $this->info('Dump-autoload...');
     $this->composer->dumpAutoloads();
 }
Exemple #26
0
 /**
  * Create a new command instance.
  *
  * @return void
  */
 public function __construct(Composer $composer)
 {
     parent::__construct();
     $this->composer = $composer;
     $this->composer->dumpAutoloads();
 }
 /**
  * Dump autoload classes
  *
  * @return void
  */
 public function dumpAutoload()
 {
     // Also run composer dump-autoload
     $composer = new Composer($this->app['files']);
     $this->info('Generating optimized class loader');
     $composer->dumpOptimized();
     $this->line('');
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     parent::fire();
     $this->composer->dumpAutoloads();
 }