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