/**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->resolver->setDefaultConnection($this->getDatabase());
     $this->getSeeder()->run();
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->resolver->setDefaultConnection($this->getDatabase());
     Model::unguarded(function () {
         $this->getSeeder()->__invoke();
     });
 }
 /**
  * @return mixed
  */
 public function handle()
 {
     // TODO: Implement handle() method.
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->resolver->setDefaultConnection($this->getDatabase());
     Model::unguarded(function () {
         $this->getSeeder()->run();
     });
 }
Exemple #4
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $tenants = $this->manager->getRepository()->getTenants();
     $seeder = $this->getSeeder();
     foreach ($tenants as $tenant) {
         $this->manager->bootstrapConnectionByTenantName($tenant->tenant_name);
         $this->resolver->setDefaultConnection($tenant->tenant_name);
         $this->manager->assumeTenant($tenant->id, true);
         $seeder->run();
         $this->output->writeln('<info>Seeded tenant ' . $tenant->tenant_name . '</info>');
         $this->manager->restoreTenant();
     }
 }
 /**
  * Set the default connection name.
  *
  * @param  string  $name
  * @return void
  */
 public function setConnection($name)
 {
     if (!is_null($name)) {
         $this->resolver->setDefaultConnection($name);
     }
     $this->repository->setSource($name);
     $this->connection = $name;
 }
Exemple #6
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->resolver->setDefaultConnection($this->getDatabase());
     $this->getSeeder()->run();
 }