Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
hfpp2012
/
laravel-blog
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 39b7e621
authored
Sep 07, 2017
by
hfpp2012 yinsigan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
paginate
1 parent
f4518035
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
app/Http/Controllers/UsersController.php
resources/views/admin/users/index.blade.php
app/Http/Controllers/UsersController.php
View file @
39b7e62
...
...
@@ -9,7 +9,8 @@ class UsersController extends Controller
{
public
function
index
()
{
$users
=
User
::
all
();
$users
=
User
::
paginate
(
5
);
// $users = User::simplePaginate(5);
return
view
(
'admin.users.index'
,
compact
(
'users'
));
}
...
...
resources/views/admin/users/index.blade.php
View file @
39b7e62
...
...
@@ -3,6 +3,8 @@
@section('content')
<div
class=
"row"
>
<div
class=
"col-md-6 col-md-offset-3"
>
<h3>
{{ $users->total() }} total users
</h3>
<b>
In this page {{ $users->count() }} users
</b>
<ul
class=
'list-group'
>
@foreach($users as $user)
<li
class=
'list-group-item'
style=
"margin-top: 20px;"
>
...
...
@@ -14,6 +16,7 @@
</li>
@endforeach
</ul>
{{ $users->links() }}
</div>
</div>
@endsection
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment