本文整理匯總了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());
}