updates to controllers for moon requests:

This commit is contained in:
2020-02-26 21:04:55 -06:00
parent 9c4d0bc46f
commit 4652e293b1
3 changed files with 59 additions and 2 deletions

View File

@@ -136,6 +136,17 @@ class MoonsController extends Controller
return redirct('/moons/display/request')->with('error', 'Region was not found.');
}
//Check to see if the moon is not available
$future = AllianceMoon::where([
'System' => $request->system,
'Planet' => $request->planet,
'Moon' => $request->moon,
])->get();
if($future->Available != 'Available') {
return redirect('/moons/display/request')->with('error', 'The moon has already been reserved by another party.');
}
//Create the new object to save into the database
$moonRequest = new AllianceMoonRequest;