public function contactId($id) { $info = info::where('name', 'contact')->limit(1)->get()[0]; $helps = help::all(); $events = event::all(); $services = service::all(); $checkServiceArray = eventServices::where('event_id', $id)->get(); $checkService; $currEvent = event::find($id); foreach ($checkServiceArray as $check) { $checkService[] = $check->service_id; } if (!empty($currEvent)) { return view('pages.contact', compact('helps', 'events', 'services', 'checkService', 'currEvent', 'info')); } return redirect('/contact'); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $services = service::all(); return View::make('admin.services.index', compact('services')); }