phpvms/app/Http/Controllers/Frontend/UserController.php

35 lines
794 B
PHP
Raw Normal View History

<?php
namespace App\Http\Controllers\Frontend;
2018-02-21 12:33:09 +08:00
use App\Http\Controllers\Controller;
use App\Repositories\UserRepository;
use Illuminate\Http\Request;
class UserController extends Controller
{
private $userRepo;
2018-02-21 12:33:09 +08:00
/**
* UserController constructor.
* @param UserRepository $userRepo
*/
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
*/
public function index(Request $request)
{
return $this->view('users.index',[
'country' => new \League\ISO3166\ISO3166(),
'users' => $this->userRepo->orderBy('name', 'desc')->paginate(25),
]);
}
}