2021-01-23 20:09:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
|
|
use Ramsey\Uuid\Uuid;
|
2021-06-13 17:26:47 +00:00
|
|
|
use Carbon\CarbonImmutable;
|
2021-01-23 20:09:16 +00:00
|
|
|
use Pterodactyl\Models\Backup;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
|
|
|
|
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 [
|
|
|
|
'uuid' => Uuid::uuid4()->toString(),
|
|
|
|
'name' => $this->faker->sentence,
|
|
|
|
'disk' => Backup::ADAPTER_WINGS,
|
2021-06-13 17:26:47 +00:00
|
|
|
'is_successful' => true,
|
|
|
|
'created_at' => CarbonImmutable::now(),
|
|
|
|
'completed_at' => CarbonImmutable::now(),
|
2021-01-23 20:09:16 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|