/**
  * 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);
         });
     }
 }
Esempio n. 2
0
 function viewusers(Request $request)
 {
     $users = User::all();
     $data['users'] = $users;
     $data['menu'] = 5;
     return view('viewusers', $data);
 }
Esempio n. 3
0
 /**
  * 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())]);
 }
Esempio n. 4
0
 public function getUser()
 {
     return User::all();
 }
Esempio n. 5
0
 /**
  * Get all users in database or return error.
  *
  * @return string
  */
 public static function getUsers()
 {
     return User::all();
 }
 public function indexAction()
 {
     $users = User::all();
     $data['users'] = $users;
     return $this->render('user/index.html.twig', $data);
 }
Esempio n. 7
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = User::all();
     return response()->json($users);
 }
 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;
 }
 /**
  * @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;
     })]);
 }
Esempio n. 10
0
 public function all()
 {
     return User::all();
 }
Esempio n. 11
0
 public function cli()
 {
     $users = User::all();
     echo $users->toJson();
 }