public function index() { $allmeetups = Meetup::with('attendees')->where('admin_id', Auth::user()->id)->orderBy('created_at', 'desc')->paginate(10); $allattending = DB::table('attendees')->where('attendee_id', Auth::user()->id)->get(); $allgoing = []; if ($allattending != null) { foreach ($allattending as $attending) { $meetup = Meetup::find($attending->meetup_id); $meetupinfo = array('id' => $meetup->id, 'title' => $meetup->title, 'location' => $meetup->location, 'date' => $meetup->date, 'time' => $meetup->time, 'votes' => $meetup->votes()->count()); array_push($allgoing, $meetupinfo); } } return View::make('/meetups/index')->with('allmeetups', $allmeetups)->with('allgoing', $allgoing); }
public function showMeetups() { $meetups = Meetup::with('attendees')->orderBy('created_at', 'desc')->paginate(10); return View::make('feed.meets')->with('meetups', $meetups); }