24 lines
629 B
PHP
24 lines
629 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Invitation;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class InvitationFactory extends Factory
|
|
{
|
|
protected $model = Invitation::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'email' => $this->faker->unique()->safeEmail(),
|
|
'role' => $this->faker->randomElement(['admin', 'developer', 'viewer']),
|
|
'invited_by_user_id' => User::factory(),
|
|
'sent_at' => now(),
|
|
'expires_at' => now()->addDays(7),
|
|
];
|
|
}
|
|
}
|