Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/database/Factories/NodeFactory.php
7458 views
1
<?php
2
3
namespace Database\Factories;
4
5
use Ramsey\Uuid\Uuid;
6
use Illuminate\Support\Str;
7
use Pterodactyl\Models\Node;
8
use Illuminate\Support\Facades\Crypt;
9
use Illuminate\Database\Eloquent\Factories\Factory;
10
11
class NodeFactory extends Factory
12
{
13
/**
14
* The name of the factory's corresponding model.
15
*
16
* @var string
17
*/
18
protected $model = Node::class;
19
20
/**
21
* Define the model's default state.
22
*/
23
public function definition(): array
24
{
25
return [
26
'uuid' => Uuid::uuid4()->toString(),
27
'public' => true,
28
'name' => 'FactoryNode_' . Str::random(10),
29
'fqdn' => $this->faker->unique()->ipv4,
30
'scheme' => 'http',
31
'behind_proxy' => false,
32
'memory' => 1024,
33
'memory_overallocate' => 0,
34
'disk' => 10240,
35
'disk_overallocate' => 0,
36
'upload_size' => 100,
37
'daemon_token_id' => Str::random(Node::DAEMON_TOKEN_ID_LENGTH),
38
'daemon_token' => Crypt::encrypt(Str::random(Node::DAEMON_TOKEN_LENGTH)),
39
'daemonListen' => 8080,
40
'daemonSFTP' => 2022,
41
'daemonBase' => '/var/lib/pterodactyl/volumes',
42
];
43
}
44
}
45
46