本文整理汇总了PHP中App\Repositories\UserRepository::findAll方法的典型用法代码示例。如果您正苦于以下问题:PHP UserRepository::findAll方法的具体用法?PHP UserRepository::findAll怎么用?PHP UserRepository::findAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\Repositories\UserRepository
的用法示例。
在下文中一共展示了UserRepository::findAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of users
*
* @param Request $request
* @return Response
*/
public function index(Request $request)
{
$search = $request->all();
// dd($search);
if (!count($search) > 0 || !isset($search['q'])) {
$search['q'] = "";
}
$search['active'] = isset($search['active']) ? $search['active'] : '';
$search['dir'] = isset($search['dir']) ? $search['dir'] : '';
$search['order'] = isset($search['order']) ? $search['order'] : '';
$users = $this->userRepository->findAll($search);
//dd($search['dir']);
return View('admin.users.index')->with(['users' => $users, 'search' => $search['q'], 'selectedStatus' => $search['active'], 'order' => $search['order'], 'dir' => $search['dir'] == '' ? '' : ($search['dir'] == 'desc' ? 'asc' : 'desc')]);
}