public function __construct() { // $productQuery = Globex::with('images')->select('id', 'title', 'description', 'price', DB::raw('0 as type')); // $adQuery = Advertisement::with('images')->select('id', 'title', 'description','price', DB::raw('1 as type')); // $motorQuery = Motor::with('images')->select('id', 'title', 'description','price', DB::raw('2 as type')); // $this->products = $adQuery->get()->merge($productQuery->get())->merge($motorQuery->get()); $this->products = Product::with('producible')->get(); $this->emirates = Emirate::all(); $this->cats = Category::whereDepth(0)->get(); }
/** * Show the form for creating a new resource. * * @return Response */ public function create(CategoryRepository $categoryRepository) { return view('pages.adposts', ['categories' => $categoryRepository->getCats(), 'emirates' => Emirate::all()]); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $profile = Profile::find($id); return view('pages.editprofile', ['profile' => $profile, 'emirates' => Emirate::all()]); }