name = $name; $this->nationality = $nationality; $this->sanction = $sanction; } /** * Returns count of aml. * * @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.name.gadget', $count = 10) { if (User::hasRole('user')) { $this->name->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\NameUserCriteria()); } $name = $this->name->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('aml::' . $view, compact('name'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.nationality.gadget', $count = 10) { if (User::hasRole('user')) { $this->nationality->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\NationalityUserCriteria()); } $nationality = $this->nationality->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('aml::' . $view, compact('nationality'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.sanction.gadget', $count = 10) { if (User::hasRole('user')) { $this->sanction->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\SanctionUserCriteria()); } $sanction = $this->sanction->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('aml::' . $view, compact('sanction'))->render(); } }