From c304c32b2852373eb80ca2b130cc11a00ec0491b Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Mon, 20 May 2019 01:07:31 -0500 Subject: [PATCH] added new features to the admin panel --- app/Http/Controllers/Dashboard/AdminController.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Dashboard/AdminController.php b/app/Http/Controllers/Dashboard/AdminController.php index cffc90d70..214952e1f 100644 --- a/app/Http/Controllers/Dashboard/AdminController.php +++ b/app/Http/Controllers/Dashboard/AdminController.php @@ -87,17 +87,20 @@ class AdminController extends Controller * Example: userArrs[0]['name'] = Minerva Arbosa * userArrs[0]['permissions'] = ['admin', 'contract.admin', superuser] */ - $users = User::orderBy('name', 'desc')->get()->toArray(); - foreach($users as $user) { + $usersTable = User::orderBy('name', 'desc')->get()->toArray(); + foreach($usersTable as $user) { $permissions = UserPermission::where([ 'character_id' => $user['character_id'], ])->get()->toArray(); - $tempUser['name'] = $user['name']; + $tempUser['name'] = $user['name']; $tempUser['role'] = $user['user_type']; $tempUser['permissions'] = $permissions; array_push($userArr, $tempUser); + + $permissions->delete(); + $tempUser->delete(); } //Get the users from the database to allow a selection of users for various parts of the webpage