public function storeList($productGroup) { // $data = $this->userData($request); // $data['title'] = 'Economix Video Bio-Gas Digestors'; // $data['description'] = 'Video Bio-Gas Digestors'; // // return view('linksbiogas',$data); return UserStores::where('product_group', $productGroup)->orderBy('name')->get(); }
public function saveeditStore($storeId, Request $request) { $addProducts = $request->input('addProducts'); \Log::info("addProducts = {$addProducts}"); \Log::info("storeId={$storeId}"); $store = UserStores::find($storeId); if ($request->input('Delete')) { $productGroup = $store->product_group; $userId = $store->user_id; $store->delete(); return $this->addStore($productGroup, $userId, $request); } $user = Users::find($store->user_id); $logo = $this->addImage($user->id, $request, $store->id); if ($logo > '') { $store->logo = $logo; } if ($request->input('name') > '') { $store->name = $request->input('name'); } if ($request->input('gen_description') > '') { $store->gen_description = $request->input('gen_description'); } if ($request->input('detailed_description') > '') { $store->detailed_description = $request->input('detailed_description'); } if ($request->input('owner_description') > '') { $store->owner_description = $request->input('owner_description'); } $store->allow_custom_requests = $request->input('allow_custom_requests'); $store->shipping_id = $request->input('shipping_id'); $store->handling_charge = $request->input('handling'); $store->save(); if ($addProducts) { return $this->addProducts($storeId, $request); } $stores = UserStores::where('user_id', $user->id)->orderBy('name')->lists('name', 'id'); $data = $this->userData($request); $data['stores'] = $stores; $data['shippingTypes'] = $this->shipping(); $data['title'] = 'Add New Store'; $data['description'] = 'Add New Store'; $data['name'] = $store->name; $data['gen_description'] = $store->gen_description; $data['logo'] = $store->logo; $data['id'] = $store->id; $data['detailed_description'] = $store->detailed_description; $data['owner_description'] = $store->owner_description; $data['shipping_id'] = $store->shipping_id; $data['storeId'] = $store->id; $data['store_type'] = $store->store_type; $data['allow_custom_requests'] = $store->allow_custom_requests; $data['handling_charge'] = $store->handling_charge; return view('store_edit', $data); }