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


PHP User::all方法代码示例

本文整理汇总了PHP中App\Model\User::all方法的典型用法代码示例。如果您正苦于以下问题:PHP User::all方法的具体用法?PHP User::all怎么用?PHP User::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在App\Model\User的用法示例。


在下文中一共展示了User::all方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     $users = Model\User::all(['first_name']);
     /** @var Model\User[] $users */
     foreach ($users as $user) {
         $mailer->raw(sprintf("Hi %s,\nWe have a new book %s by %s.\nRegards,\nYour Library", $user->first_name, $this->book->title, $this->book->author), function ($message) use($user) {
             $message->subject('Brand new book');
             $message->from(getenv('EMAIL_FROM'));
             $message->to($user->email);
         });
     }
 }
开发者ID:rtyshyk,项目名称:binary-studio-library-task,代码行数:17,代码来源:SendNewBookEmail.php

示例2: viewusers

 function viewusers(Request $request)
 {
     $users = User::all();
     $data['users'] = $users;
     $data['menu'] = 5;
     return view('viewusers', $data);
 }
开发者ID:ninekao099,项目名称:travelmate,代码行数:7,代码来源:TravelController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $users = User::all();
     return $this->respond(['data' => $this->UserTransformer->transformCollection($users->toArray())]);
 }
开发者ID:RichNwankwo,项目名称:Vyvian,代码行数:10,代码来源:UserController.php

示例4: getUser

 public function getUser()
 {
     return User::all();
 }
开发者ID:mrcoco,项目名称:slim3-eloquent-skeleton,代码行数:4,代码来源:Acl.php

示例5: getUsers

 /**
  * Get all users in database or return error.
  *
  * @return string
  */
 public static function getUsers()
 {
     return User::all();
 }
开发者ID:Munk91,项目名称:Hovedopgave,代码行数:9,代码来源:UserRepository.php

示例6: indexAction

 public function indexAction()
 {
     $users = User::all();
     $data['users'] = $users;
     return $this->render('user/index.html.twig', $data);
 }
开发者ID:huynhtrucquyen0812,项目名称:sifoni-blog,代码行数:6,代码来源:UserController.php

示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = User::all();
     return response()->json($users);
 }
开发者ID:viethoang0703,项目名称:blogs,代码行数:10,代码来源:UserController.php

示例8: dispatch

 public function dispatch(Request $request, Response $response, $args)
 {
     $this->logger->info("Home page action dispatched");
     $this->view->render($response, 'home.twig', ['user' => User::all()]);
     return $response;
 }
开发者ID:mrcoco,项目名称:slim3-eloquent-skeleton,代码行数:6,代码来源:HomeAction.php

示例9: borrowView

 /**
  * @param Request $request
  * @param $bookId
  * @return \Illuminate\View\View
  */
 public function borrowView(Request $request, $bookId)
 {
     $book = Book::find($bookId);
     return view('book.borrow', ['book' => $book, 'users' => User::all()->keyBy('id')->map(function ($item) {
         return $item->first_name . ' ' . $item->last_name;
     })]);
 }
开发者ID:rtyshyk,项目名称:binary-studio-library-task,代码行数:12,代码来源:BookController.php

示例10: all

 public function all()
 {
     return User::all();
 }
开发者ID:dzirg44,项目名称:dogpro,代码行数:4,代码来源:UserController.php

示例11: cli

 public function cli()
 {
     $users = User::all();
     echo $users->toJson();
 }
开发者ID:mrcoco,项目名称:slim-micro-mvc,代码行数:5,代码来源:UserController.php


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