/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $this->Form = new Form(route('manager::manager.api.users.index'), 'GET'); $this->Config(); try { $data = $this->Model->all(); return $this->SetSuccessJsonResponseData($data); } catch (ModelNotFoundException $e) { return $this->SetErrorJsonResponseData($e); } }
/** * Display a listing of the resource. * * @return Response */ public function index() { $title = 'CONFIG'; $country = Country::all()->sortBy('country'); $designation = Designation::all()->sortBy('designation'); $city = City::all()->sortBy('city'); $state = State::all()->sortBy('state'); $brands = Brands::all()->sortBy('brand'); $models = Models::all()->sortBy('model'); $businessType = BusinessType::all()->sortBy('name'); return view('myConfig.index', compact('title', 'country', 'designation', 'city', 'state', 'brands', 'models', 'businessType')); }
/** * Display list of model from storage * @return static */ public function model() { return Models::all()->lists('model', 'model'); }
public function editProducts($id) { if (Auth::user()->email == '*****@*****.**') { $products = Products::findOrFail($id); $images = DB::select('select * from product_images where in_product = ?', [$id]); $productCategories = ProductCategories::all(); $subProductCategories = subProductCategories::all(); $brands = Brands::all(); $models = Models::all(); return view('admin.edit-products')->with('products', $products)->with('images', $images)->with('productCategories', $productCategories)->with('subProductCategories', $subProductCategories)->with('brands', $brands)->with('models', $models); } return redirect('/'); }
public function searchProducts(Request $request) { $query = $request->input('search-query'); if ($query == '') { return redirect('/'); } if ($request->input('model') == '') { $products = Products::where(DB::raw("name"), 'LIKE', "%{$query}%")->paginate(18); $products->setPath('/search?search-query=' . $query); } else { $products = Products::where(DB::raw("name"), 'LIKE', "%{$query}%")->where('model', $request->input('model'))->paginate(18); $products->setPath('/search?search-query=' . $query . '&model=' . $request->input('model')); } $brands = Brands::all(); $models = Models::all(); $productImages = DB::table('product_images')->get(); $count = 0; // making clearfix for latest products return view('pages.search-results')->with('query', $query)->with('products', $products)->with('query', $query)->with('brands', $brands)->with('models', $models)->with('productImages', $productImages)->with('count', $count); }