1
0
mirror of https://github.com/cp6/my-idlers.git synced 2024-11-16 15:33:44 +01:00

Updated the server choose compare method

Updated the server choose compare method
If 2 suitable servers aren't found then throw an error alert
This commit is contained in:
cp6 2022-10-13 14:20:26 +11:00
parent 4b3e72bc93
commit dcb8a78ff8

View File

@ -208,7 +208,13 @@ class ServerController extends Controller
public function chooseCompare()
{//NOTICE: Selecting servers is not cached yet
$all_servers = Server::where('has_yabs', 1)->get();
return view('servers.choose-compare', compact('all_servers'));
if (isset($all_servers[1])){
return view('servers.choose-compare', compact('all_servers'));
}
return redirect()->route('servers.index')
->with('error', 'You need atleast 2 servers with a YABS to do a compare');
}
public function compareServers($server1, $server2)