Example #1
0
 private function getDropboxOfCategories()
 {
     $categories = Category::all();
     $map = [];
     foreach ($categories as $category) {
         $map[$category->id] = $category->name;
     }
     return $map;
 }
Example #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     //
     $cateId = $request->input('cateId');
     if (is_null($cateId) || $cateId == 0) {
         $cateId = 0;
         $artList = Article::orderBy('id', 'DESC')->paginate(10);
     } else {
         $artList = Article::where('cate_id', $cateId)->orderBy('id', 'DESC')->paginate(10);
     }
     return backendView('index', ['cateId' => $cateId, 'article' => $artList, "cates" => Category::all()]);
 }
Example #3
0
 public function getDone(Request $request)
 {
     $id = $request->get('paymentId');
     $token = $request->get('token');
     $payer_id = $request->get('PayerID');
     $payment = PayPal::getById($id, $this->_apiContext);
     $paymentExecution = PayPal::PaymentExecution();
     $paymentExecution->setPayerId($payer_id);
     $executePayment = $payment->execute($paymentExecution, $this->_apiContext);
     \Cart::clear();
     return view('frontend.checkout.done')->with('categories', Category::all())->with('pay', $executePayment);
 }
Example #4
0
 private static function top()
 {
     \Menu::handler('category')->hydrate(function () {
         return \App\Model\Category::all();
     }, function ($child, $item) {
         $child->add(route('publication.category', $item->slug), $item->name);
     });
     \Menu::handler('category')->addClass('list-group');
     \Menu::handler('category')->getItemsAtDepth(0)->map(function ($item) {
         if ($item->isActive()) {
             $item->getContent()->addClass('active');
         }
         $item->getContent()->addClass('list-group-item');
     });
 }
 public function index()
 {
     $persons = Category::all();
     return view('dream.person.category', ['persons' => $persons]);
 }
 function viewcategory(Request $request)
 {
     $category = Category::all();
     $data['category'] = $category;
     $data['menu'] = 2;
     return view('addcategory', $data);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $categories = Category::all();
     return response()->json($categories);
 }
Example #8
0
 public function postCheckout(Request $request)
 {
     \DB::beginTransaction();
     $customer = Customer::create($request->all());
     $order = $customer->orders()->create(['quantity' => \Cart::getTotalQuantity(), 'total' => \Cart::getTotal(), 'shipped' => false]);
     foreach (\Cart::getContent() as $cart) {
         $order->details()->create(['deal_id' => $cart->id, 'quantity' => $cart->quantity, 'price' => $cart->price]);
     }
     $order->push();
     $customer->push();
     \DB::commit();
     \Cart::clear();
     return view('frontend.checkout.done')->with('categories', Category::all());
 }
Example #9
0
 /**
  * Create a new authentication controller instance.
  *
  * @return void
  */
 public function __construct()
 {
     $this->middleware('guest', ['except' => 'getLogout']);
     View::share('categories', Category::all());
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $productobj = new Product();
     $product = $productobj->find($id);
     $productCategories = Category::all();
     $productCategId = Category::find($product->category_id);
     $moduleId = 2;
     //product
     //get the image assiociates
     $prodFiles = Files::where('attachment_id', $product->id)->where('is_active', True)->where('module_id', $moduleId)->get();
     //materials sesction
     //get all materials associated
     $curMaterials = array();
     $curMatIds = array();
     $prodMaterials = Product::find($id)->materials()->get();
     foreach ($prodMaterials as $pm) {
         //gets the current set materials
         $matExtObject = Material::where('is_active', true)->where('id', $pm->material_id)->first();
         array_push($curMaterials, $matExtObject);
         array_push($curMatIds, $pm->material_id);
         $matExtObject = null;
     }
     //get all the materials not in current product
     $allMaterials = Material::whereNotIn('id', $curMatIds)->orderBy('material_name', 'asc')->get();
     //subproducts section
     //get all subproducts associated
     $curSubProducts = array();
     $curSubProductIds = array();
     $subProducts = Product::find($id)->sub_products()->get();
     foreach ($subProducts as $pm) {
         //gets the current set materials
         $subprodExtObject = SubProduct::where('is_active', true)->where('id', $pm->sub_product_id)->first();
         array_push($curSubProducts, $subprodExtObject);
         array_push($curSubProductIds, $pm->sub_product_id);
         $subprodExtObject = null;
     }
     //get all the subproducts not in current main product
     $allSubProducts = SubProduct::whereNotIn('id', $curSubProductIds)->orderBy('sub_product_name', 'asc')->get();
     return view('pages.admin.product.edit', ['product' => $product, 'productCategories' => $productCategories, 'productCategId' => $productCategId, 'prodFiles' => $prodFiles, 'allMaterials' => $allMaterials, 'curMaterials' => $curMaterials, 'allSubProducts' => $allSubProducts, 'curSubProducts' => $curSubProducts, 'moduleId' => $moduleId]);
 }
Example #11
0
 public function randomz()
 {
     $query = catdb::all()->random(1);
     return $query;
 }
 public function gets(Category $categories)
 {
     $categories->all();
 }
Example #13
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $categories = Category::all();
     return view('admin.category.index', ['categories' => $categories]);
 }
Example #14
0
 public function create()
 {
     $datas = ['categories' => catdb::all()];
     return view('Pages/Movies/create', $datas);
 }
Example #15
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $category = Category::all();
     return response()->json($category);
 }