Commit c137fbd7 authored by Nicolas Widart's avatar Nicolas Widart

Getting the users

parent abeac097
<?php namespace Modules\User\Http\Controllers\Admin; <?php namespace Modules\User\Http\Controllers\Admin;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
use Modules\Core\Http\Controllers\Admin\AdminBaseController; use Modules\Core\Http\Controllers\Admin\AdminBaseController;
class UserController extends 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. * Display a listing of the resource.
* *
...@@ -12,7 +25,9 @@ class UserController extends AdminBaseController ...@@ -12,7 +25,9 @@ class UserController extends AdminBaseController
*/ */
public function index() 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 @@ ...@@ -39,18 +39,18 @@
<?php foreach($users as $user): ?> <?php foreach($users as $user): ?>
<tr> <tr>
<td> <td>
<a href="{{ URL::route('dashboard.user.edit', $user->id) }}"> <a href="{{ URL::route('dashboard.user.edit', [$user->id]) }}">
{{ $user->created_at }} {{ $user->created_at }}
</a> </a>
</td> </td>
<td> <td>
<a href="{{ URL::route('dashboard.user.edit', $user->id) }}"> <a href="{{ URL::route('dashboard.user.edit', [$user->id]) }}">
{{ $user->first_name }} {{ $user->first_name }}
</a> </a>
</td> </td>
<td> <td>
<div class="btn-group"> <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> <button class="btn btn-danger btn-flat" data-toggle="modal" data-target="#confirmation-{{ $user->id }}"><i class="glyphicon glyphicon-trash"></i></button>
</div> </div>
</td> </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