mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-12-14 23:23:37 +08:00
a83150131a
Due to queue serialization. Added a test to check a couple of delete events. Added ApiTokenFactory to support. Also made a couple of typing/doc updates while there. Related to #4373
28 lines
688 B
PHP
28 lines
688 B
PHP
<?php
|
|
|
|
namespace Database\Factories\Api;
|
|
|
|
use BookStack\Api\ApiToken;
|
|
use BookStack\Users\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Carbon;
|
|
use Illuminate\Support\Str;
|
|
|
|
class ApiTokenFactory extends Factory
|
|
{
|
|
protected $model = ApiToken::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'token_id' => Str::random(10),
|
|
'secret' => Str::random(12),
|
|
'name' => $this->faker->name(),
|
|
'expires_at' => Carbon::now()->addYear(),
|
|
'created_at' => Carbon::now(),
|
|
'updated_at' => Carbon::now(),
|
|
'user_id' => User::factory(),
|
|
];
|
|
}
|
|
}
|