This commit is contained in:
2019-12-01 04:07:50 -06:00
parent 410f28a4c3
commit eef64b414e

View File

@@ -57,16 +57,21 @@ class BlacklistController extends Controller
if($count === 0) {
//Get the character id from the universe end point
$charId = $lookup->CharacterNameToId($request->name);
//Insert the character into the blacklist table
BlacklistUser::insert([
'character_id' => $charId,
'name' => $request->name,
'reason' => $request->reason,
'alts' => $request->alts,
'lister_id' => auth()->user()->getId(),
'lister_name' => auth()->user()->getName(),
]);
if($charId != -1) {
//Insert the character into the blacklist table
BlacklistUser::insert([
'character_id' => $charId,
'name' => $request->name,
'reason' => $request->reason,
'alts' => $request->alts,
'lister_id' => auth()->user()->getId(),
'lister_name' => auth()->user()->getName(),
]);
} else {
//Redirect back to the view
return redirect('/blacklist/display/add')->with('error', $request->name . ' has been biomassed.');
}
} else {
//Return the view
return view('blacklist.add')->with('error', 'Character is already on the black list.');