Skip to content

Commit 9ee11ad

Browse files
committed
Added paginate onEachSide
1 parent ff58529 commit 9ee11ad

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

app/Http/Controllers/Admin/PermissionController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ public function index()
4242
$permissions->latest();
4343
}
4444

45-
$permissions = $permissions->paginate(5);
45+
$permissions = $permissions->paginate(5)->onEachSide(2);
4646

47-
return view('admin.permission.index',compact('permissions'))
48-
->with('i', (request()->input('page', 1) - 1) * 5);
47+
return view('admin.permission.index', compact('permissions'));
4948
}
5049

5150
/**

app/Http/Controllers/Admin/RoleController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ public function index()
4343
$roles->latest();
4444
}
4545

46-
$roles = $roles->paginate(5);
46+
$roles = $roles->paginate(5)->onEachSide(2);
4747

48-
return view('admin.role.index',compact('roles'))
49-
->with('i', (request()->input('page', 1) - 1) * 5);
48+
return view('admin.role.index', compact('roles'));
5049
}
5150

5251
/**

app/Http/Controllers/Admin/UserController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ public function index()
4747
$users->latest();
4848
}
4949

50-
$users = $users->paginate(5);
50+
$users = $users->paginate(5)->onEachSide(2);
5151

52-
return view('admin.user.index',compact('users'))
53-
->with('i', (request()->input('page', 1) - 1) * 5);
52+
return view('admin.user.index', compact('users'));
5453
}
5554

5655
/**

0 commit comments

Comments
 (0)