*/ class TenantFactory extends Factory { /** * @return array */ public function definition(): array { return [ 'subdomain' => 'tenant-'.Str::lower(Str::random(8)), 'organization_name' => fake()->company(), 'contact_email' => fake()->unique()->safeEmail(), 'timezone' => 'Europe/Moscow', 'locale' => 'ru', 'is_trial' => true, 'api_key_limit' => 5, ]; } /** * G1/SP2: тенант с заполненными лёгкими реквизитами — проходит гейт первого * проекта. Используется тестами, которые создают проекты у нового тенанта. */ public function withRequisites(): static { return $this->afterCreating(function (Tenant $tenant): void { TenantRequisites::create([ 'tenant_id' => $tenant->id, 'subject_type' => 'individual', 'contact_name' => 'Test Contact', 'contact_phone' => '+79150000000', ]); }); } }