/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $twoweeks = time() - 7 * 24 * 60 * 60 * 2; $events = \teambernieny\Event::with('neighborhood')->with('files')->with('volunteers')->where('Date', '>', date('Y-m-d', $twoweeks))->where('id', '!=', '1')->orderby('Date', 'DESC')->get(); $eventrows = array(); foreach ($events as $event) { $totalrows = 0; foreach ($event->files as $file) { $totalrows = $totalrows + $file->TotalRows; $filenew = \teambernieny\File::with('user')->find($file->id); $file = $filenew; } $eventrows[$event->id] = $totalrows; } $view->with(['events' => $events, 'eventrows' => $eventrows]); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $events = \teambernieny\Event::with('neighborhood')->with('volunteers')->where('id', '!=', '1')->orderby('Date', 'DESC')->get(); $view->with(['events' => $events]); }
private function returnfileAdd(Request $request) { $event = \teambernieny\Event::with('files')->find($request->event_id); return view('file.add')->with(['event' => $event]); }
public function getAll(Request $request) { $events = \teambernieny\Event::with('neighborhood')->orderby('id', 'DESC')->get(); return view('event.search.all')->with(['events' => $events]); }