<?php

namespace App\Classes\General\Eloquent\Filters;

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

class Importer implements Filter
{

    /**
     * @param Builder $builder
     * @param $value
     * @return Builder|mixed
     */
    public static function apply(Builder $builder, $value)
    {
        return $builder->whereHas('modules', function ($query){
            $query->where('module_type', ModuleTypes::IMPORTER);
        });

    }

}