/** * Dashboard for user's content management, only for auth user. */ public function dashboard() { $user = Sentry::getUser(); $added_events = ep\Event::where('author_id', '=', $user->id)->orderBy('created_at', 'DESC')->paginate(25); $added_shows = Show::where('author_id', '=', $user->id)->orderBy('created_at', 'DESC')->paginate(25); return View::make('user.dashboard', array('user' => $user, 'added_events' => $added_events, 'added_shows' => $added_shows, 'pageTitle' => 'Dashboard')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $users = User::all(); $events_submitted = ep\Event::where('approved', '=', '0')->get(); $event_count = ep\Event::all()->count(); $shows_submitted = Show::where('approved', '=', '0')->get(); $show_count = Show::all()->count(); $extras_submitted = Extra::where('approved', '=', '0')->get(); $extra_count = Extra::all()->count(); $beta_count = DB::table('beta_newsletters')->count(); return View::make('admin.admin_panel', array('pageTitle' => 'Admin Panel', 'users' => $users, 'event_count' => $event_count, 'events_submitted' => $events_submitted, 'show_count' => $show_count, 'shows_submitted' => $shows_submitted, 'extra_count' => $extra_count, 'beta_count' => $beta_count, 'extras_submitted' => $extras_submitted)); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { if (Sentry::check()) { $event = ep\Event::where('id', '=', $id)->orWhere('slug', '=', $id)->first(); $streams = $event->eventStream()->get(); $games = $event->eventGame()->get(); $extras = $event->eventExtra()->where('approved', '=', '1')->orderBy('created_at', 'desc')->get(); return View::make('event.show_event_tz', array('pageTitle' => $event->title, 'event' => $event, 'streams' => $streams, 'games' => $games, 'extras' => $extras, 'i' => '1')); } $event = ep\Event::where('id', '=', $id)->orWhere('slug', '=', $id)->first(); $streams = $event->eventStream()->get(); $games = $event->eventGame()->get(); $extras = $event->eventExtra()->where('approved', '=', '1')->orderBy('created_at', 'desc')->get(); return View::make('event.show_event', array('pageTitle' => $event->title, 'event' => $event, 'streams' => $streams, 'games' => $games, 'extras' => $extras, 'i' => '1')); }