career_job = $career_job; $this->career_category = $career_category; $this->career_application = $career_application; $this->career_meta = $career_meta; } /** * Returns count of career. * * @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.career_job.gadget', $count = 10) { if (User::hasRole('user')) { $this->career_job->pushCriteria(new \Litepie\Pure\Repositories\Criteria\CareerJobUserCriteria()); } $career_job = $this->career_job->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('career::' . $view, compact('career_job'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.career_category.gadget', $count = 10) { if (User::hasRole('user')) { $this->career_category->pushCriteria(new \Litepie\Pure\Repositories\Criteria\CareerCategoryUserCriteria()); } $career_category = $this->career_category->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('career::' . $view, compact('career_category'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.career_application.gadget', $count = 10) { if (User::hasRole('user')) { $this->career_application->pushCriteria(new \Litepie\Pure\Repositories\Criteria\CareerApplicationUserCriteria()); } $career_application = $this->career_application->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('career::' . $view, compact('career_application'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.career_meta.gadget', $count = 10) { if (User::hasRole('user')) { $this->career_meta->pushCriteria(new \Litepie\Pure\Repositories\Criteria\CareerMetaUserCriteria()); } $career_meta = $this->career_meta->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('career::' . $view, compact('career_meta'))->render(); } }