Skip to content

Commit

Permalink
Removing extra unneeded queries on role views
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Oct 12, 2017
1 parent f79554d commit 101b838
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions Modules/User/Http/Controllers/Admin/RolesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down Expand Up @@ -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');
}

/**
Expand Down

0 comments on commit 101b838

Please sign in to comment.