repository = $repository; $this->encrypter = $encrypter; } /** * Create a new node on the panel. * * @param array $data * @return \Pterodactyl\Models\Node * * @throws \Pterodactyl\Exceptions\Model\DataValidationException */ public function handle(array $data) { $data['daemon_token'] = Str::random(Node::DAEMON_TOKEN_LENGTH); $data['daemon_token_id'] = $this->encrypter->encrypt(Str::random(Node::DAEMON_TOKEN_ID_LENGTH)); return $this->repository->create($data, true, true); } }