/** * 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); }); } }
function viewusers(Request $request) { $users = User::all(); $data['users'] = $users; $data['menu'] = 5; return view('viewusers', $data); }
/** * 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())]); }
public function getUser() { return User::all(); }
/** * 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); }
/** * 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; })]); }
public function all() { return User::all(); }
public function cli() { $users = User::all(); echo $users->toJson(); }