/** * Check secret code for order and get object if it exists. */ public function store() { if (\Input::has('password')) { $p = trim(\Input::get('password')); if (!empty($p)) { $check = \Veer\Models\Order::whereHas('secrets', function ($query) use($p) { $query->where('secret', '=', $p); })->pluck('id'); if (!empty($check)) { return $this->showingOrder($this->showOrder->getOrderWithSite(app('veer')->siteId, $check, null, true)); } } } return $this->index(); }
protected function filterOrderByProducts($filter_id) { return \Veer\Models\Order::whereHas('products', function ($query) use($filter_id) { $query->where('products_id', '=', $filter_id); }); }