Commit 40f36deb by hfpp2012 yinsigan

forelse

1 parent 39b7e621
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<h3>{{ $users->total() }} total users</h3> <h3>{{ $users->total() }} total users</h3>
<b>In this page {{ $users->count() }} users</b> <b>In this page {{ $users->count() }} users</b>
<ul class='list-group'> <ul class='list-group'>
@foreach($users as $user) @forelse($users as $user)
<li class='list-group-item' style="margin-top: 20px;"> <li class='list-group-item' style="margin-top: 20px;">
<span>{{ $user->name }}</span> <span>{{ $user->name }}</span>
<span class="pull-right clearfix"> <span class="pull-right clearfix">
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
</span> </span>
<button class='btn btn-xs btn-primary'>Follow</button> <button class='btn btn-xs btn-primary'>Follow</button>
</li> </li>
@endforeach @empty
<li>No users available</li>
@endforelse
</ul> </ul>
{{ $users->links() }} {{ $users->links() }}
</div> </div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!