TenantAtlas/database/factories/PlatformUserFactory.php
2026-01-27 22:44:54 +01:00

37 lines
905 B
PHP

<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\PlatformUser>
*/
class PlatformUserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'password' => static::$password ??= Hash::make('password'),
'capabilities' => [],
'is_active' => true,
'last_login_at' => null,
'remember_token' => Str::random(10),
];
}
}