public function getOutletStatData() { $outletsArray = array(); $dealsArray = array(); $outlets = Outlet::owner()->get(); $deals = Deal::dashboardDeal(); foreach ($outlets as $outlet) { $dealsArray = array(); foreach ($deals as $deal) { if ($outlet->id == $deal->outlet_id) { $dealsArray[] = $deal; } } if (count($dealsArray)) { $outletsArray[$outlet->id] = array('name' => $outlet->name, 'deal' => $dealsArray); } } return $outletsArray; }
public function owner() { return Outlet::owner(); }
/** * Display the specified outlet. * * @param int $id * @return Response */ public function getList() { $outlets = Outlet::owner()->active()->paginate(10); $title = Lang::get('site/outlets/title.outlet_management'); return View::make('site.outlets.index', compact('outlets', 'title')); }