<?php

namespace App\Classes\General\Eloquent\Filters;


use Illuminate\Database\Eloquent\Builder;

class WithCompanyModuleType implements Filter
{

    /**
     * @param Builder $builder
     * @param $value
     * @return mixed
     */
    public static function apply(Builder $builder, $value)
    {
        return $builder->whereHas('companyModule', function ($query) use ($value) {
            $query->where('company_modules.type', '=', $value);
        });
    }
}
