File: /home/xedaptot/ai.naniguide.com/database/factories/AdAccountFactory.php
<?php
namespace Database\Factories;
use App\Model\AdAccount;
use App\Model\AdPlatform;
use Illuminate\Database\Eloquent\Factories\Factory;
class AdAccountFactory extends Factory
{
protected $model = AdAccount::class;
public function definition(): array
{
return [
'uid' => uniqid(),
'ad_platform_id' => AdPlatform::factory(),
'remote_account_id' => 'act_' . $this->faker->randomNumber(8),
'name' => $this->faker->company() . ' Ad Account',
'currency' => 'USD',
'timezone' => $this->faker->timezone(),
'status' => AdAccount::STATUS_ACTIVE,
'is_default' => true,
];
}
public function forPlatform(AdPlatform $platform): static
{
return $this->state(fn () => ['ad_platform_id' => $platform->id]);
}
}