2018-01-20 06:07:31 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Frontend;
|
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
use App\Interfaces\Controller;
|
2018-01-20 06:07:31 +08:00
|
|
|
use App\Repositories\UserRepository;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
/**
|
|
|
|
* Class UserController
|
|
|
|
* @package App\Http\Controllers\Frontend
|
|
|
|
*/
|
2018-01-20 06:07:31 +08:00
|
|
|
class UserController extends Controller
|
|
|
|
{
|
|
|
|
private $userRepo;
|
|
|
|
|
2018-02-21 12:33:09 +08:00
|
|
|
/**
|
|
|
|
* UserController constructor.
|
|
|
|
* @param UserRepository $userRepo
|
|
|
|
*/
|
2018-01-20 06:07:31 +08:00
|
|
|
public function __construct(
|
|
|
|
UserRepository $userRepo
|
|
|
|
) {
|
|
|
|
$this->userRepo = $userRepo;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-02-21 12:33:09 +08:00
|
|
|
* @param Request $request
|
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
2018-01-20 06:07:31 +08:00
|
|
|
*/
|
|
|
|
public function index(Request $request)
|
|
|
|
{
|
2018-03-20 09:50:40 +08:00
|
|
|
return view('users.index', [
|
2018-01-20 06:07:31 +08:00
|
|
|
'country' => new \League\ISO3166\ISO3166(),
|
2018-03-20 09:50:40 +08:00
|
|
|
'users' => $this->userRepo->orderBy('name', 'desc')->paginate(),
|
2018-01-20 06:07:31 +08:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|