Пример #1
0
 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();
 }
Пример #2
0
 /**
  * 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()]);
 }
Пример #3
0
 /**
  * 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()]);
 }