<?php

namespace App\Classes\General\Eloquent\Filters;

use App\Classes\ValueObjects\Constants\SegmentConstants;
use Illuminate\Database\Eloquent\Builder;

class ServiceType implements Filter
{

    /**
     * @param Builder $builder
     * @param $value
     * @return Builder|mixed
     */
    public static function apply(Builder $builder, $value)
    {
        return $builder->where('reference', SegmentConstants::SERVICE_TYPE)->where('detail->id', $value);
    }

}