<?php

namespace Modules\CabBooking\Repositories\Api;

use Exception;
use App\Exceptions\ExceptionHandler;
use Modules\CabBooking\Models\ServiceCategory;
use Prettus\Repository\Eloquent\BaseRepository;
use Prettus\Repository\Criteria\RequestCriteria;

class ServiceCategoryRepository extends BaseRepository
{
    public function model()
    {
        return ServiceCategory::class;
    }

    public function boot()
    {
        try {

            $this->pushCriteria(app(RequestCriteria::class));

        } catch (Exception $e) {

            throw new ExceptionHandler($e->getMessage(), $e->getCode());
        }
    }

    public function show($id)
    {
        try {

            return $this->model->findOrFail($id);

        } catch (Exception $e) {

            throw new ExceptionHandler($e->getMessage(), $e->getCode());
        }
    }
}
