/** * Show the form for creating a new resource. * * @return Response */ public function create() { $stateList = State::lists('name', 'name'); $catList = Cat::lists('name', 'id'); $featured = Biz::whereFeatured('YES')->get(); return view('pages.regbiz', compact('stateList', 'catList', 'featured')); }
public function profile($userId) { $cats = Cat::all(); $user = \App\User::findOrFail($userId); $bizs = $user->favours; $favourites = \DB::table('favourites')->whereUserId(\Auth::user()->id)->lists('biz_id'); //$bizs = Biz::orderBy('created_at', 'desc')->paginate(6); $stateList = State::lists('name', 'name'); $lgaList = Lga::lists('name', 'id'); $catList = Cat::lists('name', 'name'); $featured = Biz::whereFeatured('YES')->paginate(3); $recent = Biz::orderBy('created_at', 'desc')->paginate(2); // dd($featured); return view('pages.user-profile', compact('stateList', 'lgaList', 'catList', 'cats', 'bizs', 'user', 'favourites', 'featured', 'recent', 'totalBiz', 'totalCat')); }