/**
  * Execute the command.
  *
  * @return void
  */
 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();
 }
Example #2
0
 /**
  * Execute the console command.
  * @return mixed
  */
 public function handle()
 {
     $this->installNpmPackageConfig();
     $this->installBowerPackageConfig();
     $this->installGulpFile();
     $this->installServiceProviders();
     $this->installExeptionHandler();
     $this->installRequests();
     $this->installRoutes();
     $this->installModels();
     $this->installMigrations();
     $this->installJupiterConfig();
     $this->installAssets();
     $this->installPublicResources();
     $this->installEnvironmentVariables();
     $this->installTerms();
     $this->call('key:generate');
     $this->table(['Task', 'Status'], [['Installing Jupiter Features', '<info>✔</info>']]);
     $this->composer->dumpAutoloads();
     if ($this->option('force') || $this->confirm('Would you like to run your database migrations?', 'yes')) {
         (new Process('php artisan migrate', base_path()))->setTimeout(null)->run();
         (new Process('php artisan db:seed', base_path()))->setTimeout(null)->run();
     }
     if ($this->option('force') || $this->confirm('Would you like to install your NPM dependencies?', 'yes')) {
         (new Process('npm install', base_path()))->setTimeout(null)->run();
     }
     if ($this->option('force') || $this->confirm('Would you like to install your Bower dependencies?', 'yes')) {
         (new Process('bower install', base_path()))->setTimeout(null)->run();
     }
     if ($this->option('force') || $this->confirm('Would you like to run Gulp?', 'yes')) {
         (new Process('gulp', base_path()))->setTimeout(null)->run();
     }
     $this->displayPostInstallationNotes();
 }
Example #3
0
 /**
  * Install a single Displore package.
  *
  * @param string $package
  */
 public function installSinglePackage($package)
 {
     // Check if we should give composer the `--dev` flag.
     if ($this->option('dev')) {
         // Execute composer.
         $this->composer->requireDevDependency('displore/' . $package);
         // if composer failed, show the errors.
         if ($this->composer->composerErrors) {
             $this->error($this->composer->composerErrors);
             exit;
         }
         // Do some magic with Laravel (see below).
         $this->SetLaravelLogic('displore/' . $package);
         // Dump the autoloads and you're good to go!
         $this->composer->dumpAutoloads();
         $this->info('Successfully installed displore/' . $package);
     } else {
         // Execute composer.
         $this->composer->requireDependency('displore/' . $package);
         // if composer failed, show the errors.
         if ($this->composer->composerErrors) {
             $this->error($this->composer->composerErrors);
             exit;
         }
         // Do some magic with Laravel (see below).
         $this->SetLaravelLogic('displore/' . $package);
         // Dump the autoloads and you're good to go!
         $this->composer->dumpAutoloads();
         $this->info('Successfully installed displore/' . $package);
     }
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $fullPath = $this->createBaseMigration();
     $this->files->put($fullPath, $this->files->get(__DIR__ . '/stubs/notifications.stub'));
     $this->info('Migration created successfully!');
     $this->composer->dumpAutoloads();
 }
 /**
  * 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();
     $stubPath = __DIR__ . '/../../stubs/auth.stub';
     $this->files->put($fullPath, $this->files->get($stubPath));
     $this->info('Migration created successfully!');
     $this->composer->dumpAutoloads();
 }
Example #7
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->loadDefinitionFile();
     $migration = $this->definition->getMigration();
     $name = $migration->getDefinitionKey('name');
     $this->writeMigration($name, $migration->output());
     $this->composer->dumpAutoloads();
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $dir = $this->laravel->databasePath() . '/anonymization';
     $this->createDirectory($dir);
     $this->createAnonymizer($dir, 'DatabaseAnonymizer');
     $this->createAnonymizer($dir, 'UserTableAnonymizer');
     $this->composer->dumpAutoloads();
     $this->info("Installation completed");
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $this->setAttribs();
     foreach ($this->fileTypes as $type) {
         $this->createFile($type);
     }
     $this->addRoute();
     $this->composer->dumpAutoloads();
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->createMigrations();
     $this->info('Installed VerifyController');
     file_put_contents(app_path('Http/Controllers/Auth/VerifyController.php'), $this->compileControllerStub());
     $this->info('Updated routes.php');
     $this->appendRoutes();
     $this->composer->dumpAutoloads();
 }
Example #11
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $table = $this->laravel['config']['queue.connections.database.table'];
     $tableClassName = Str::studly($table);
     $fullPath = $this->createBaseMigration($table);
     $stub = str_replace(['{{table}}', '{{tableClassName}}'], [$table, $tableClassName], $this->files->get(__DIR__ . '/stubs/jobs.stub'));
     $this->files->put($fullPath, $stub);
     $this->info('Migration created successfully!');
     $this->composer->dumpAutoloads();
 }
Example #12
0
 /**
  * Execute the console command.
  *
  * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
  */
 public function fire()
 {
     $files = $this->creator->getFilesystem();
     $name = 'create_eloquent_log_table';
     $path = $this->creator->create($name, $this->getMigrationPath());
     $file = pathinfo($path, PATHINFO_FILENAME);
     $files->put($path, $files->get(__DIR__ . '/stubs/database.stub'));
     $this->line("<info>Created Migration:</info> {$file}");
     $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();
 }
Example #14
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');
 }
 public function performPostActions($runMigration = false)
 {
     if ($this->commandData->options['save']) {
         $this->saveSchemaFile();
     }
     if ($runMigration) {
         if ($this->confirm("\nDo you want to migrate database? [y|N]", false)) {
             $this->call('migrate');
         }
     }
     $this->info("Generating autoload files");
     $this->composer->dumpOptimized();
 }
Example #16
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->info('Generating optimized class loader');
     if ($this->option('psr')) {
         $this->composer->dumpAutoloads();
     } else {
         $this->composer->dumpOptimized();
     }
     if ($this->option('force') || !$this->laravel['config']['app.debug']) {
         $this->info('Compiling common classes');
         $this->compileClasses();
     } else {
         $this->call('clear-compiled');
     }
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     // Start the progress bar
     $bar = $this->helper->barSetup($this->output->createProgressBar(7));
     $bar->start();
     // Common variables
     // Starting with vendor/package, optionally defined interactively
     if ($this->option('i')) {
         $vendor = $this->ask('What is the vendor name?', $this->getVendorArgumentOfInput());
         $nameModule = $this->ask('What is the package name?', $this->getNameOfModuleOfInput());
         $nameSeeder = $this->ask('What will be the name of the Seeder class?', $this->argument('nameSeeder'));
     } else {
         $vendor = $this->getVendorArgumentOfInput();
         $nameModule = $this->getNameOfModuleOfInput();
         $nameSeeder = $this->argument('nameSeeder');
     }
     $namelowercase = strtolower($nameModule);
     //$path = getcwd() . '/packages/';
     $path = base_path('packages/');
     $this->info($path);
     $fullPath = $path . $vendor . '/' . $nameModule;
     $pathDatabaseSeedersFolder = $fullPath . '/src/Database/Seeders';
     $this->info("Stap 1 : The path to the seeders is : " . $pathDatabaseSeedersFolder);
     //Stap 2 : The vendor's name is : FilipWebShop
     $this->info("Stap 2 : The vendor's name is : " . $vendor);
     //Stap 3 : The name of the module is : Test2
     $this->info("Stap 3 : The name of the module is : " . $nameModule);
     //Stap 4 : the name of the migration is : Create_Folders_Table
     $this->info("Stap 4 : the name of the seeder is : " . $nameSeeder);
     $this->writeSeeder($bar, $vendor, $nameModule, $nameSeeder, $pathDatabaseSeedersFolder);
     $this->finishHandleAndProgressBar($bar, 'Seeder created successfully!');
     $this->composer->dumpAutoloads();
 }
Example #18
0
 /**
  * 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();
 }
Example #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();
 }
Example #20
0
 /**
  * Generate the desired migration.
  */
 protected function makeModule()
 {
     $this->makeBase();
     $this->makeDirectory($this->parser['path']);
     $this->makeInterface();
     $this->makeClass();
     $this->makeValidator();
     $this->info('Migration created successfully . ');
     $this->composer->dumpAutoloads();
 }
 /**
  * Setup views and assets
  *
  */
 private function makeViews()
 {
     foreach ($this->views as $view) {
         // index, create, show, edit, duplicate, _form, _common
         new MakeView($this, $this->files, $view);
     }
     //Dump autoload
     $this->info('Dump-autoload...');
     $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');
 }
 /**
  * Execute the console command.
  */
 public function fire()
 {
     try {
         $this->makeMigrationBase($this->options);
         $provider = $this->getAuthProvider();
         $this->makeMigrationPivot(['provider' => $provider, 'roles_table' => $this->options['roles_table']]);
         $this->composer->dumpAutoloads();
     } catch (\Exception $e) {
         $this->error($e->getMessage());
     }
 }
 /**
  * Generate the desired repository.
  */
 protected function makeRepository()
 {
     foreach ($this->meta['paths'] as $key => $path) {
         if ($this->files->exists($path)) {
             return $this->error($this->meta['filenames'][$key] . ' already exists!');
         }
         $this->makeDirectory($path);
     }
     $this->makeContract();
     $this->makeEloquent();
     $this->makeModel();
     $this->composer->dumpAutoloads();
 }
Example #25
0
 /**
  * Command Handler.
  *
  * @param \Notadd\Foundation\Extension\ExtensionManager           $manager
  * @param \Notadd\Foundation\Setting\Contracts\SettingsRepository $settings
  *
  * @return true
  * @throws \Exception
  */
 public function fire(ExtensionManager $manager, SettingsRepository $settings)
 {
     $name = $this->input->getArgument('name');
     $extensions = $manager->getExtensionPaths();
     if (!$extensions->offsetExists($name)) {
         $this->error("Extension {$name} do not exist!");
         return false;
     }
     if (!$settings->get('extension.' . $name . '.installed')) {
         $this->error("Extension {$name} does not installed!");
         return false;
     }
     $path = $extensions->get($name);
     if (Str::contains($path, $manager->getVendorPath())) {
         $this->error("Please remove extension {$name} from composer.json!");
         return false;
     }
     $this->composer->dumpAutoloads();
     $settings->set('extension.' . $name . '.installed', false);
     $this->info("Extension {$name} is uninstalled!");
     return true;
 }
 private function createMigration($name)
 {
     $filename = $this->buildMigrationFilename($name);
     if ($this->files->exists(database_path($filename))) {
         $this->error('Migration already exists!');
         return false;
     }
     $migration = $this->buildMigration($name);
     $this->files->put(database_path('/migrations/' . $filename), $migration);
     if (env('APP_ENV') != 'testing') {
         $this->composer->dumpAutoloads();
     }
     $this->info('Created migration ' . $filename);
     return true;
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     // Start the progress bar
     $bar = $this->helper->barSetup($this->output->createProgressBar(7));
     $bar->start();
     // Common variables
     // Starting with vendor/package, optionally defined interactively
     if ($this->option('i')) {
         $vendor = $this->ask('What is the vendor name?', $this->getVendorArgumentOfInput());
         $nameModule = $this->ask('What is the package name?', $this->getNameOfModuleOfInput());
         $nameMigration = $this->ask('What will be the name of the migration?', $this->argument('nameMigration'));
     } else {
         $vendor = $this->getVendorArgumentOfInput();
         $nameModule = $this->getNameOfModuleOfInput();
         $nameMigration = $this->argument('nameMigration');
     }
     $namelowercase = strtolower($nameModule);
     $path = base_path('packages/');
     $fullPath = $path . $vendor . '/' . $nameModule;
     $pathDatabaseMigrationFolder = $fullPath . '/src/Database/Migrations';
     //Voorbeeld: 'packages/FilipWebShop/test/src/Database/Migrations';
     //Stap 1 : The path to the migrations is :
     // D:\laragon\www\laravel-webshop-filip-boilerplate\packages
     // /FilipWebShop/Test2/src/Database/Migrations
     $this->info("Stap 1 : The path to the migrations is : " . $pathDatabaseMigrationFolder);
     //Stap 2 : The vendor's name is : FilipWebShop
     $this->info("Stap 2 : The vendor's name is : " . $vendor);
     //Stap 3 : The name of the module is : Test2
     $this->info("Stap 3 : The name of the module is : " . $nameModule);
     //Stap 4 : the name of the migration is : Create_Folders_Table
     $this->info("Stap 4 : the name of the migration is : " . $nameMigration);
     // 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.
     $nameMigration = trim($this->input->getArgument('nameMigration'));
     $table = $this->input->getOption('table');
     //$this->info("the name of the table is : " . $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($nameMigration, $table, $create, $pathDatabaseMigrationFolder);
     $this->finishHandleAndProgressBar($bar, 'Migration file created successfully!');
     $this->composer->dumpAutoloads();
 }
Example #28
0
 /**
  * Command handler.
  *
  * @param \Notadd\Foundation\Extension\ExtensionManager           $manager
  * @param \Notadd\Foundation\Setting\Contracts\SettingsRepository $settings
  *
  * @return bool
  * @throws \Exception
  */
 public function fire(ExtensionManager $manager, SettingsRepository $settings)
 {
     $this->name = $this->input->getArgument('name');
     $extensions = $manager->getExtensionPaths();
     if (!$extensions->offsetExists($this->name)) {
         $this->error("Extension {$this->name} do not exist!");
         return false;
     }
     if ($settings->get("extension.{$this->name}.installed")) {
         $this->error("Extension {$this->name} is installed!");
         return false;
     }
     $this->path = $extensions->get($this->name);
     if (Str::contains($this->path, $manager->getVendorPath())) {
         $this->error("Extension {$this->name} is installed!");
         return false;
     }
     $this->postInstall($settings);
     $this->composer->dumpAutoloads();
     $this->resetOpcache();
     $settings->set("extension.{$this->name}.installed", true);
     $this->info("Extension {$this->name} is installed!");
     return true;
 }
 protected function updateComposer()
 {
     $arVendor = explode('\\', $this->option('namespace'));
     $currentComposer = $arVendor[0] . '\\\\' . $arVendor[1] . '\\\\": "packages/' . $arVendor[0] . '/' . $arVendor[1] . '/src",';
     $requirement = '"psr-4": {
         "' . $currentComposer;
     $currentProvider = $arVendor[0] . '\\' . $arVendor[1] . '\\' . $this->getObjName('Name') . 'ServiceProvider::class,';
     $providerClass = 'Kun\\Generator\\GeneratorServiceProvider::class,
     ' . $currentProvider;
     $composer = $this->files->get(getcwd() . '/composer.json');
     if ($this->files->isDirectory(getcwd() . '/config')) {
         $appConfig = $this->files->get(getcwd() . '/config/app.php');
         if (strpos($appConfig, $currentProvider) === false) {
             $appConfig = str_replace('Kun\\Generator\\GeneratorServiceProvider::class,', $providerClass, $appConfig);
             $this->files->put(getcwd() . '/config/app.php', $appConfig);
         }
     }
     if (strpos($composer, $currentComposer) === false) {
         $composer = str_replace('"psr-4": {', $requirement, $composer);
         $this->files->put(getcwd() . '/composer.json', $composer);
         $this->info('Adding package to composer and app...');
     }
     $this->composer->dumpAutoloads();
 }
Example #30
0
 /**
  * Execute the console command.
  */
 public function handle()
 {
     $model = trim($this->argument('model'));
     $this->writeMapping($model);
     $this->composer->dumpAutoloads();
 }