public function getPage3() { $userdetails = array('name' => Session::get('username'), 'event' => Session::get('event')); // $questions = Question::where('event','=',Session::get('event'))->where('page','=',3)->orderBy('order')->with('choices') // ->with(array('answers'=>function($query){ // $query->where('user_id','=',Session::get('userid')); // }))->get(); $questions = Question::where('page', '=', 3)->orderBy('order')->with('choices')->with(array('answers' => function ($query) { $query->where('user_id', '=', Session::get('userid')); }))->get(); $categoryvendors = Categoryvendor::where('event', '=', Session::get('event'))->with(array('categoryvendoranswer' => function ($q) { $q->where('user_id', '=', Session::get('userid')); }))->get(); return View::make('forms.page3')->with(array('userdetails' => $userdetails, 'questions' => $questions, 'categoryvendors' => $categoryvendors)); // return View::make('forms.page3')->with(array('userdetails'=>$userdetails,'questions'=>$questions)); }
public function getCategoryvendors() { $categoryvendors = Categoryvendor::where('event', '=', Session::get('tempevenname3'))->orderby('categoryname')->get(); return View::make('admin.categoryvendors')->with(array('categoryvendors' => $categoryvendors)); }