Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinecraft committed Jun 1, 2024
1 parent d9a0dcd commit 5c2dbb6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/Http/Controllers/Admin/ServerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function storeBungee(Request $request, GeolocationService $geolocationSer
'ip_address' => 'required|ip',
'join_port' => 'required|numeric|min:0|max:65535',
'query_port' => 'required|numeric|min:0|max:65535',
'webquery_port' => 'nullable|numeric|min:0|max:65535|required_if_accepted:is_server_intel_enabled',
'webquery_port' => 'nullable|numeric|min:0|max:65535|required_if_accepted:is_server_intel_enabled|different:join_port',
'name' => 'required',
'minecraft_version' => ['required', new EnumValue(ServerVersion::class)],
'settings' => 'sometimes',
Expand All @@ -171,6 +171,11 @@ public function storeBungee(Request $request, GeolocationService $geolocationSer
'created_by' => $request->user()->id,
]);

if (! $request->webquery_port) {
return redirect()->route('admin.server.index')
->with(['toast' => ['type' => 'success', 'title' => __('Created Successfully'), 'body' => __('Proxy server added successfully')]]);
}

return Inertia::render('Admin/Server/AfterCreateSteps', [
'server' => $server,
'apiKey' => $pluginSettings->plugin_api_key,
Expand Down Expand Up @@ -267,7 +272,7 @@ public function updateBungee(Request $request, Server $server, GeolocationServic
'ip_address' => 'required|ip',
'join_port' => 'required|numeric|min:0|max:65535',
'query_port' => 'required|numeric|min:0|max:65535',
'webquery_port' => 'nullable|numeric|min:0|max:65535|required_if_accepted:is_server_intel_enabled',
'webquery_port' => 'nullable|numeric|min:0|max:65535|required_if_accepted:is_server_intel_enabled|different:join_port',
'name' => 'required',
'minecraft_version' => ['required', new EnumValue(ServerVersion::class)],
'settings' => 'sometimes',
Expand Down

0 comments on commit 5c2dbb6

Please sign in to comment.