Commit c137fbd7 authored by Nicolas Widart's avatar Nicolas Widart

Getting the users

parent abeac097
<?php namespace Modules\User\Http\Controllers\Admin;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Illuminate\Support\Facades\View;
use Modules\Core\Http\Controllers\Admin\AdminBaseController;
class UserController extends AdminBaseController
{
/**
* @var \Modules\Session\Entities\User
*/
protected $users;
public function __construct()
{
parent::__construct();
$this->users = Sentinel::getUserRepository();
}
/**
* Display a listing of the resource.
*
......@@ -12,7 +25,9 @@ class UserController extends AdminBaseController
*/
public function index()
{
return View::make('user::admin.index');
$users = $this->users->createModel()->paginate();
return View::make('user::admin.index', compact('users'));
}
/**
......
......@@ -39,18 +39,18 @@
<?php foreach($users as $user): ?>
<tr>
<td>
<a href="{{ URL::route('dashboard.user.edit', $user->id) }}">
<a href="{{ URL::route('dashboard.user.edit', [$user->id]) }}">
{{ $user->created_at }}
</a>
</td>
<td>
<a href="{{ URL::route('dashboard.user.edit', $user->id) }}">
<a href="{{ URL::route('dashboard.user.edit', [$user->id]) }}">
{{ $user->first_name }}
</a>
</td>
<td>
<div class="btn-group">
<a href="{{ URL::route('dashboard.user.edit', $user->id) }}" class="btn btn-default btn-flat"><i class="glyphicon glyphicon-pencil"></i></a>
<a href="{{ URL::route('dashboard.user.edit', [$user->id]) }}" class="btn btn-default btn-flat"><i class="glyphicon glyphicon-pencil"></i></a>
<button class="btn btn-danger btn-flat" data-toggle="modal" data-target="#confirmation-{{ $user->id }}"><i class="glyphicon glyphicon-trash"></i></button>
</div>
</td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment