<?php

namespace App\Repositories;

use Prettus\Repository\Eloquent\BaseRepository;
use Prettus\Repository\Criteria\RequestCriteria;
use App\Repositories\HomePageSliderRepository;
use App\Models\HomePageSlider;
use App\Validators\HomePageSliderValidator;

/**
 * Class HomePageSliderRepositoryEloquent.
 *
 * @package namespace App\Repositories;
 */
class HomePageSliderRepositoryEloquent extends BaseRepository implements HomePageSliderRepository
{
    /**
     * Specify Model class name
     *
     * @return string
     */
    public function model()
    {
        return HomePageSlider::class;
    }

    
    public function indexPage()
    {
        $get_sliders = parent::all();
        return view('admin.home-sliders.index', compact('get_sliders'));
    }

    public function createPage()
    {
        return view('admin.home-sliders.add');

    }
    public function editPage($id)
    {
        $find_slider = parent::find($id);
        return view('admin.home-sliders.update', compact('find_slider'));

    }

    public function create($data)
    {
        return  parent::create($data);
    }
    public function update($data, $id)
    {
        return parent::update($data, $id);

    }

    public function delete($id)
    {
        return parent::delete($id);
    }

    public function getById($id)
    {
        return parent::find($id);
    }


    public function getAllSliders()
    {
        return parent::all();
    }
    /**
     * Boot up the repository, pushing criteria
     */
    public function boot()
    {
        $this->pushCriteria(app(RequestCriteria::class));
    }
    
}
