*/ class HeroSlideRepository extends BaseRepository implements HeroSlideRepositoryInterface { public function __construct(HeroSlide $model) { parent::__construct($model); } /** * @param array $filters * @return LengthAwarePaginator */ public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator { return $this->model->newQuery() ->orderBy('order_index') ->paginate($perPage); } /** * @return Collection */ public function active(): Collection { return Cache::remember('hero_slides', 3600, fn () => $this->model->newQuery() ->where('is_active', true) ->orderBy('order_index') ->get()); } }