From 101b838416cf85dda80270117a546aa70701f591 Mon Sep 17 00:00:00 2001 From: Nicolas Widart Date: Thu, 12 Oct 2017 16:37:09 +0200 Subject: [PATCH] Removing extra unneeded queries on role views --- .../Http/Controllers/Admin/RolesController.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Modules/User/Http/Controllers/Admin/RolesController.php b/Modules/User/Http/Controllers/Admin/RolesController.php index 7bfb4a03a..e42fbf55c 100644 --- a/Modules/User/Http/Controllers/Admin/RolesController.php +++ b/Modules/User/Http/Controllers/Admin/RolesController.php @@ -28,9 +28,7 @@ public function __construct(PermissionManager $permissions, RoleRepository $role */ public function index() { - $roles = $this->role->all(); - - return view('user::admin.roles.index', compact('roles')); + return view('user::admin.roles.index'); } /** @@ -61,17 +59,11 @@ public function store(UpdateRoleRequest $request) /** * Show the form for editing the specified resource. * - * @param int $id * @return Response */ - public function edit($id) + public function edit() { - if (!$role = $this->role->find($id)) { - return redirect()->route('admin.user.role.index') - ->withError(trans('user::messages.role not found')); - } - - return view('user::admin.roles.edit', compact('role')); + return view('user::admin.roles.edit'); } /**