コード例 #1
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->resolver->setDefaultConnection($this->getDatabase());
     $this->getSeeder()->run();
 }
コード例 #2
0
ファイル: SeedCommand.php プロジェクト: bryanashley/framework
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->resolver->setDefaultConnection($this->getDatabase());
     Model::unguarded(function () {
         $this->getSeeder()->__invoke();
     });
 }
コード例 #3
0
 /**
  * @return mixed
  */
 public function handle()
 {
     // TODO: Implement handle() method.
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->resolver->setDefaultConnection($this->getDatabase());
     Model::unguarded(function () {
         $this->getSeeder()->run();
     });
 }
コード例 #4
0
ファイル: SeedCommand.php プロジェクト: stillat/database
 /**
  * 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();
     }
 }
コード例 #5
0
 /**
  * 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;
 }
コード例 #6
0
ファイル: SeedCommand.php プロジェクト: flelievre/EasyVisit
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->resolver->setDefaultConnection($this->getDatabase());
     $this->getSeeder()->run();
 }