date ?? Carbon::now()->toDateString(); return view('journal.index') ->with('entries', JournalEntry::where([ 'user_id' => Auth::user()->id, 'date' => $date, ])->get()) ->with('date', Carbon::createFromFormat('Y-m-d', $date)) ->with('nutrients', ['calories', 'fat', 'cholesterol', 'carbohydrates', 'sodium', 'protein']); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // } /** * Display the specified resource. * * @param \App\Models\JournalEntry $journalEntry * @return \Illuminate\Http\Response */ public function show(JournalEntry $journalEntry) { // } /** * Show the form for editing the specified resource. * * @param \App\Models\JournalEntry $journalEntry * @return \Illuminate\Http\Response */ public function edit(JournalEntry $journalEntry) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param \App\Models\JournalEntry $journalEntry * @return \Illuminate\Http\Response */ public function update(Request $request, JournalEntry $journalEntry) { // } /** * Remove the specified resource from storage. * * @param \App\Models\JournalEntry $journalEntry * @return \Illuminate\Http\Response */ public function destroy(JournalEntry $journalEntry) { // } }