From f8506f9d20ab8a7205c69279b06ae5dd0d1acb3c Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 14 Aug 2023 15:25:03 +0200 Subject: [PATCH] fix: self-hosted --- app/Http/Controllers/ServerController.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php index 1a5876c81..dc98fc258 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/ServerController.php @@ -12,10 +12,17 @@ class ServerController extends Controller public function new_server() { + if (!is_cloud()) { + return view('server.create', [ + 'limit_reached' => false, + 'private_keys' => PrivateKey::ownedByCurrentTeam()->get(), + ]); + } $servers = auth()->user()->currentTeam()->servers->count(); - $subscription = auth()->user()->currentTeam()->subscription->type(); + $subscription = auth()->user()->currentTeam()?->subscription->type(); $limits = config('constants.limits.server')[strtolower($subscription)]; $limit_reached = true ?? $servers >= $limits[$subscription]; + return view('server.create', [ 'limit_reached' => $limit_reached, 'private_keys' => PrivateKey::ownedByCurrentTeam()->get(),