ldc-crm/database/factories/SingleOptinFactory.php
2025-07-25 09:44:40 +02:00

32 lines
682 B
PHP

<?php
namespace Database\Factories;
use App\Models\Brand;
use App\Models\SingleOptin;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class SingleOptinFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = SingleOptin::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'hashcode' => Str::uuid(),
'email' => $this->faker->email(),
'brand_id' => $this->faker->randomElement(Brand::pluck('id')),
];
}
}