Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/database/Factories/ServerFactory.php
7460 views
1
<?php
2
3
namespace Database\Factories;
4
5
use Carbon\Carbon;
6
use Ramsey\Uuid\Uuid;
7
use Illuminate\Support\Str;
8
use Pterodactyl\Models\Server;
9
use Illuminate\Database\Eloquent\Factories\Factory;
10
11
class ServerFactory extends Factory
12
{
13
/**
14
* The name of the factory's corresponding model.
15
*
16
* @var string
17
*/
18
protected $model = Server::class;
19
20
/**
21
* Define the model's default state.
22
*
23
* @return array
24
*/
25
public function definition()
26
{
27
return [
28
'uuid' => Uuid::uuid4()->toString(),
29
'uuidShort' => Str::lower(Str::random(8)),
30
'name' => $this->faker->firstName,
31
'description' => implode(' ', $this->faker->sentences()),
32
'skip_scripts' => 0,
33
'status' => null,
34
'memory' => 512,
35
'swap' => 0,
36
'disk' => 512,
37
'io' => 500,
38
'cpu' => 0,
39
'threads' => null,
40
'oom_disabled' => 0,
41
'startup' => '/bin/bash echo "hello world"',
42
'image' => 'foo/bar:latest',
43
'allocation_limit' => null,
44
'database_limit' => null,
45
'backup_limit' => 0,
46
'created_at' => Carbon::now(),
47
'updated_at' => Carbon::now(),
48
];
49
}
50
}
51
52