updates to controllers for moon requests:
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user