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

42 lines
958 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 Carbon\CarbonImmutable;
2021-01-23 12:09:16 -08:00
use Illuminate\Database\Eloquent\Factories\Factory;
2026-10-05 18:10:18 -04:00
use Pterodactyl\Models\Backup;
use Pterodactyl\Models\Server;
use Ramsey\Uuid\Uuid;
2021-01-23 12:09:16 -08:00
2026-10-05 18:10:18 -04:00
/**
* @extends Factory<Backup>
*/
2021-01-23 12:09:16 -08:00
class BackupFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Backup::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
2026-10-05 18:10:18 -04:00
'server_id' => Server::factory()->withRelationships(),
2021-01-23 12:09:16 -08:00
'uuid' => Uuid::uuid4()->toString(),
2026-10-05 18:10:18 -04:00
'name' => fake()->sentence(),
'ignored_files' => [],
2021-01-23 12:09:16 -08:00
'disk' => Backup::ADAPTER_WINGS,
'is_successful' => true,
'created_at' => CarbonImmutable::now(),
'completed_at' => CarbonImmutable::now(),
2021-01-23 12:09:16 -08:00
];
}
}