Path: blob/1.0-develop/database/Factories/NodeFactory.php
7458 views
<?php12namespace Database\Factories;34use Ramsey\Uuid\Uuid;5use Illuminate\Support\Str;6use Pterodactyl\Models\Node;7use Illuminate\Support\Facades\Crypt;8use Illuminate\Database\Eloquent\Factories\Factory;910class NodeFactory extends Factory11{12/**13* The name of the factory's corresponding model.14*15* @var string16*/17protected $model = Node::class;1819/**20* Define the model's default state.21*/22public function definition(): array23{24return [25'uuid' => Uuid::uuid4()->toString(),26'public' => true,27'name' => 'FactoryNode_' . Str::random(10),28'fqdn' => $this->faker->unique()->ipv4,29'scheme' => 'http',30'behind_proxy' => false,31'memory' => 1024,32'memory_overallocate' => 0,33'disk' => 10240,34'disk_overallocate' => 0,35'upload_size' => 100,36'daemon_token_id' => Str::random(Node::DAEMON_TOKEN_ID_LENGTH),37'daemon_token' => Crypt::encrypt(Str::random(Node::DAEMON_TOKEN_LENGTH)),38'daemonListen' => 8080,39'daemonSFTP' => 2022,40'daemonBase' => '/var/lib/pterodactyl/volumes',41];42}43}444546