本文整理汇总了PHP中UserRepository::all方法的典型用法代码示例。如果您正苦于以下问题:PHP UserRepository::all方法的具体用法?PHP UserRepository::all怎么用?PHP UserRepository::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserRepository
的用法示例。
在下文中一共展示了UserRepository::all方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$users = $this->userRepository->all();
$usersObject = [];
if (is_array($users)) {
/**
* @var User $user
*/
foreach ($users as $user) {
$usersObject[] = ['id' => $user->id, 'email' => $user->email, 'firstname' => $user->name->getFirstname(), 'lastname' => $user->name->getLastname()];
}
}
return $this->toJSONResponse(['users' => $usersObject]);
}
示例2: compose
public function compose($view)
{
$this->role->pushCriteria(new RoleOrderCriteria());
$view->roles = $this->role->all();
}
示例3: index
/**
* Display list of users
*
* @return View
*/
public function index()
{
$users = $this->user->all();
return View::make('krustr::users.index', array('users' => $users));
}
示例4: factory
/** @test **/
function it_fetches_all_the_rows_with_the_given_columns()
{
factory(User::class)->times(10)->create();
$repository = new UserRepository($this->newContainerMock(new User()));
$user = $repository->all(['name'])->last();
$this->assertEquals(['name'], array_keys($user->toArray()));
}
示例5: compose
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$view->with('categories_list', $this->categories->all());
}
示例6: compose
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$view->with('tags_list', $this->tags->all());
}