authentikate/database/factories/AuthenticationTokenFactory.php
Javier Feliz 93c6baa16b
Some checks failed
linter / quality (push) Successful in 3m5s
tests / ci (push) Failing after 7m45s
Invites and some tests
2025-08-01 21:33:43 -04:00

33 lines
841 B
PHP

<?php
namespace Database\Factories;
use App\Models\Application;
use App\Models\AuthenticationToken;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\AuthenticationToken>
*/
class AuthenticationTokenFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'user_id' => User::factory(),
'application_id' => Application::factory(),
'token' => Str::random(64),
'issued_at' => now(),
'expires_at' => now()->addMonth(),
'ip' => fake()->ipv4(),
'user_agent' => fake()->userAgent(),
];
}
}