Files
pterodactyl-panel/database/Factories/SubuserFactory.php
T

39 lines
803 B
PHP
Raw Normal View History

2021-01-23 12:09:16 -08:00
<?php
2026-10-05 18:10:18 -04:00
declare(strict_types=1);
2021-01-23 12:09:16 -08:00
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
2026-10-05 18:10:18 -04:00
use Pterodactyl\Enum\Permissions;
use Pterodactyl\Models\Server;
use Pterodactyl\Models\Subuser;
use Pterodactyl\Models\User;
2021-01-23 12:09:16 -08:00
2026-10-05 18:10:18 -04:00
/**
* @extends Factory<Subuser>
*/
2021-01-23 12:09:16 -08:00
class SubuserFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Subuser::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
2026-10-05 18:10:18 -04:00
'user_id' => User::factory(),
'server_id' => Server::factory()->withRelationships(),
2021-01-23 12:09:16 -08:00
'permissions' => [
2026-10-05 18:10:18 -04:00
Permissions::WebsocketConnect->value,
2021-01-23 12:09:16 -08:00
],
];
}
}