store = $store; $this->product = $product; $this->topic = $topic; $this->region = $region; $this->storetype = $storetype; $this->prodsource = $prodsource; $this->prodcat = $prodcat; $this->topiccat = $topiccat; $this->sourcecat = $sourcecat; $this->source = $source; $this->skill = $skill; $this->skillcat = $skillcat; $this->topictype = $topictype; } /** * Returns count of master. * * @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.store.gadget', $count = 10) { if (User::hasRole('user')) { $this->store->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\StoreUserCriteria()); } $store = $this->store->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('store'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.product.gadget', $count = 10) { if (User::hasRole('user')) { $this->product->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\ProductUserCriteria()); } $product = $this->product->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('product'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.topic.gadget', $count = 10) { if (User::hasRole('user')) { $this->topic->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\TopicUserCriteria()); } $topic = $this->topic->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('topic'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.region.gadget', $count = 10) { if (User::hasRole('user')) { $this->region->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\RegionUserCriteria()); } $region = $this->region->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('region'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.storetype.gadget', $count = 10) { if (User::hasRole('user')) { $this->storetype->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\StoretypeUserCriteria()); } $storetype = $this->storetype->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('storetype'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.prodsource.gadget', $count = 10) { if (User::hasRole('user')) { $this->prodsource->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\ProdsourceUserCriteria()); } $prodsource = $this->prodsource->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('prodsource'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.prodcat.gadget', $count = 10) { if (User::hasRole('user')) { $this->prodcat->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\ProdcatUserCriteria()); } $prodcat = $this->prodcat->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('prodcat'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.topiccat.gadget', $count = 10) { if (User::hasRole('user')) { $this->topiccat->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\TopiccatUserCriteria()); } $topiccat = $this->topiccat->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('topiccat'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.sourcecat.gadget', $count = 10) { if (User::hasRole('user')) { $this->sourcecat->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\SourcecatUserCriteria()); } $sourcecat = $this->sourcecat->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('sourcecat'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.source.gadget', $count = 10) { if (User::hasRole('user')) { $this->source->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\SourceUserCriteria()); } $source = $this->source->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('source'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.skill.gadget', $count = 10) { if (User::hasRole('user')) { $this->skill->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\SkillUserCriteria()); } $skill = $this->skill->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('skill'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.skillcat.gadget', $count = 10) { if (User::hasRole('user')) { $this->skillcat->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\SkillcatUserCriteria()); } $skillcat = $this->skillcat->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('skillcat'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.topictype.gadget', $count = 10) { if (User::hasRole('user')) { $this->topictype->pushCriteria(new \Litepie\Cenos\Repositories\Criteria\TopictypeUserCriteria()); } $topictype = $this->topictype->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('master::' . $view, compact('topictype'))->render(); } }