33 lines
848 B
PHP
33 lines
848 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Enums\OrganisationRole;
|
|
use App\Models\Organisation;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\OrganisationInvitation>
|
|
*/
|
|
class OrganisationInvitationFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'organisation_id' => Organisation::factory(),
|
|
'invited_by_user_id' => User::factory(),
|
|
'email' => $this->faker->unique()->safeEmail(),
|
|
'role' => OrganisationRole::MEMBER,
|
|
'token' => Str::random(40),
|
|
'expires_at' => now()->addDays(14),
|
|
];
|
|
}
|
|
}
|