1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-16 12:04:03 +00:00

phpstan, global_cache, resolver improvements, InitializationHelpers trait

This commit is contained in:
Samuel Štancl 2022-09-29 02:47:13 +02:00
parent fd65cf1754
commit 87212e5390
35 changed files with 170 additions and 231 deletions

View file

@ -14,29 +14,16 @@ class Seed extends SeedCommand
{
use HasATenantsOption;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Seed tenant database(s).';
protected $name = 'tenants:seed';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct(ConnectionResolverInterface $resolver)
{
parent::__construct($resolver);
}
/**
* Execute the console command.
*/
public function handle()
public function handle(): int
{
foreach (config('tenancy.seeder_parameters') as $parameter => $value) {
if (! $this->input->hasParameterOption($parameter)) {
@ -45,7 +32,7 @@ class Seed extends SeedCommand
}
if (! $this->confirmToProceed()) {
return;
return 1;
}
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) {
@ -58,5 +45,7 @@ class Seed extends SeedCommand
event(new DatabaseSeeded($tenant));
});
return 0;
}
}