当前位置: 首页>>代码示例>>PHP>>正文


PHP UserRepository::all方法代码示例

本文整理汇总了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]);
 }
开发者ID:LeeKevin,项目名称:laravel-api,代码行数:19,代码来源:UsersController.php

示例2: compose

 public function compose($view)
 {
     $this->role->pushCriteria(new RoleOrderCriteria());
     $view->roles = $this->role->all();
 }
开发者ID:SocietyCMS,项目名称:User,代码行数:5,代码来源:RoleListComposer.php

示例3: index

 /**
  * Display list of users
  *
  * @return View
  */
 public function index()
 {
     $users = $this->user->all();
     return View::make('krustr::users.index', array('users' => $users));
 }
开发者ID:creolab,项目名称:krustr,代码行数:10,代码来源:UsersController.php

示例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()));
 }
开发者ID:thirteen,项目名称:repositories,代码行数:8,代码来源:AbstractRepositoryTest.php

示例5: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $view->with('categories_list', $this->categories->all());
 }
开发者ID:ambarsetyawan,项目名称:brewski,代码行数:10,代码来源:CategoriesComposer.php

示例6: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $view->with('tags_list', $this->tags->all());
 }
开发者ID:ambarsetyawan,项目名称:brewski,代码行数:10,代码来源:TagsComposer.php


注:本文中的UserRepository::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。