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