craft = $craft; $this->sector = $sector; $this->position = $position; $this->hardskill = $hardskill; } /** * Returns count of hardskill. * * @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.craft.gadget', $count = 10) { if (User::hasRole('user')) { $this->craft->pushCriteria(new \Litepie\Superrobota\Repositories\Criteria\CraftUserCriteria()); } $craft = $this->craft->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('hardskill::' . $view, compact('craft'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.sector.gadget', $count = 10) { if (User::hasRole('user')) { $this->sector->pushCriteria(new \Litepie\Superrobota\Repositories\Criteria\SectorUserCriteria()); } $sector = $this->sector->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('hardskill::' . $view, compact('sector'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.position.gadget', $count = 10) { if (User::hasRole('user')) { $this->position->pushCriteria(new \Litepie\Superrobota\Repositories\Criteria\PositionUserCriteria()); } $position = $this->position->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('hardskill::' . $view, compact('position'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.hardskill.gadget', $count = 10) { if (User::hasRole('user')) { $this->hardskill->pushCriteria(new \Litepie\Superrobota\Repositories\Criteria\HardskillUserCriteria()); } $hardskill = $this->hardskill->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('hardskill::' . $view, compact('hardskill'))->render(); } }