Skip to content

Commit dd69652

Browse files
committed
Fix No application encryption key has been specified error while trying to generate said key
1 parent 73b27ae commit dd69652

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/Providers/AppServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace Pterodactyl\Providers;
44

5-
use View;
6-
use Cache;
75
use Pterodactyl\Models;
86
use Illuminate\Support\Str;
97
use Illuminate\Support\Facades\URL;
108
use Illuminate\Pagination\Paginator;
9+
use Illuminate\Support\Facades\View;
10+
use Illuminate\Support\Facades\Cache;
1111
use Illuminate\Support\Facades\Schema;
1212
use Illuminate\Support\ServiceProvider;
1313
use Pterodactyl\Extensions\Themes\Theme;

app/Services/Nodes/NodeCreationService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class NodeCreationService
1313
/**
1414
* NodeCreationService constructor.
1515
*/
16-
public function __construct(private Encrypter $encrypter, protected NodeRepositoryInterface $repository)
16+
public function __construct(protected NodeRepositoryInterface $repository)
1717
{
1818
}
1919

@@ -25,7 +25,7 @@ public function __construct(private Encrypter $encrypter, protected NodeReposito
2525
public function handle(array $data): Node
2626
{
2727
$data['uuid'] = Uuid::uuid4()->toString();
28-
$data['daemon_token'] = $this->encrypter->encrypt(Str::random(Node::DAEMON_TOKEN_LENGTH));
28+
$data['daemon_token'] = app(Encrypter::class)->encrypt(Str::random(Node::DAEMON_TOKEN_LENGTH));
2929
$data['daemon_token_id'] = Str::random(Node::DAEMON_TOKEN_ID_LENGTH);
3030

3131
return $this->repository->create($data, true, true);

0 commit comments

Comments
 (0)