other_services = $other_services; } /** * Returns count of other_service. * * @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.other_services.gadget', $count = 10) { if (User::hasRole('user')) { $this->other_services->pushCriteria(new \Litepie\Litecms\Repositories\Criteria\OtherServicesUserCriteria()); } $other_services = $this->other_services->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('other_service::' . $view, compact('other_services'))->render(); } }