public function dashboard() { $venues = Venue::orderBy('name', 'asc')->get(); $bands = Band::orderBy('name', 'asc')->get(); $events = Event::orderBy('date', 'asc')->get(); $events_future = Event::futureEvents(); $events_past = Event::pastEvents(); return view('dashboard', compact('venues', 'events', 'events_future', 'events_past', 'bands')); }
/** * Display a dynamically generated mailer based on data available now. * * @return \Illuminate\Http\Response */ public function now() { $events = Event::futureEvents()->get(); $categories = Category::orderBy('title', 'asc')->get(); $subscriber = new Subscriber(); $subscriber->name = 'Andy Gott'; $subscriber->email = '*****@*****.**'; Mail::send('emails.subscribers.mailer', ['subscriber' => $subscriber, 'events' => $events, 'categories' => $categories], function ($m) use($subscriber) { $m->from('*****@*****.**', 'See+Do')->to($subscriber->email, $subscriber->name)->subject('Weekly Round-Up of Things to See+Do in Manchester')->getHeaders()->addTextHeader('X-MC-Subaccount', 'see-do'); }); return view('mailers.now', compact('events')); }
public function viewAll() { $events_future = Event::futureEvents(); $events_past = Event::pastEvents(); return view('archive-event', compact('events_future', 'events_past')); }