mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-15 18:14:03 +00:00
* wip * Apply fixes from StyleCI * Return value when a single tenant is passed * array map -> foreach * bug fixes
29 lines
591 B
PHP
29 lines
591 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\Traits;
|
|
|
|
use Symfony\Component\Console\Input\InputOption;
|
|
|
|
trait HasATenantsOption
|
|
{
|
|
protected function getOptions()
|
|
{
|
|
return array_merge([
|
|
['tenants', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, '', null],
|
|
], parent::getOptions());
|
|
}
|
|
|
|
protected function getTenants(): array
|
|
{
|
|
return tenancy()->all($this->option('tenants'))->all();
|
|
}
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
|
|
$this->specifyParameters();
|
|
}
|
|
}
|