place = $place; $this->distributor = $distributor; } /** * Returns count of seller. * * @param array $filter * * @return int */ public function count() { return 0; } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.place.gadget', $count = 10) { if (User::hasRole('user')) { $this->place->pushCriteria(new \Litepie\Chemical\Repositories\Criteria\PlaceUserCriteria()); } $place = $this->place->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('seller::' . $view, compact('place'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.distributor.gadget', $count = 10) { if (User::hasRole('user')) { $this->distributor->pushCriteria(new \Litepie\Chemical\Repositories\Criteria\DistributorUserCriteria()); } $distributor = $this->distributor->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('seller::' . $view, compact('distributor'))->render(); } }