From 69d92960d98ee8d56d4a34a8ac2b51ba1cce0841 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Fri, 4 Dec 2020 06:57:20 -0600 Subject: [PATCH] blacklist updates --- .../Blacklist/BlacklistController.php | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/Blacklist/BlacklistController.php b/app/Http/Controllers/Blacklist/BlacklistController.php index 5f82a36c9..685edd2c9 100644 --- a/app/Http/Controllers/Blacklist/BlacklistController.php +++ b/app/Http/Controllers/Blacklist/BlacklistController.php @@ -83,19 +83,17 @@ class BlacklistController extends Controller return redirect('/blacklist/display/add')->with('error', 'Entity Id was not found.'); } - - //Store the entity in the table - BlacklistEntity::insert([ - 'entity_id' => $entityId, - 'entity_name' => $request->name, - 'entity_type' => $request->type, - 'reason' => $request->reason, - 'alts' => $request->alts, - 'lister_id' => auth()->user()->getId(), - 'lister_name' => auth()->user()->getName(), - 'validity' => 'Valid', - ]); + $blacklist = new BlacklistEntity; + $blacklist->entity_id = $entityId; + $blacklist->entity_name = $request->name; + $blacklist->entity_type = $request->type; + $blacklist->reason = $request->reason; + $blacklist->alts = $request->alts; + $blacklist->lister_id = auth()->user()->getId(); + $blacklist->lister_name = auth()->user()->getName(); + $blacklist->validity = 'Valid'; + $blacklist->save(); //Return to the view return redirect('/blacklist/display/add')->with('success', $request->name . ' added to the blacklist.');