Files
app/database/factories/ApiKeyFactory.php
2025-12-22 12:37:16 +07:00

32 lines
601 B
PHP

<?php
namespace Database\Factories;
use App\Models\ApiKey;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class ApiKeyFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = ApiKey::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->words(3, true),
'key' => Str::random(64),
'last_used_at' => null,
];
}
}