當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。