<?php

namespace App\Classes\General\Eloquent\Filters;

use App\Models\Order;
use Illuminate\Database\Eloquent\Builder;

class OrderMarkingIn implements Filter
{
    /**
     * @param Builder $builder
     * @param $value
     * @return mixed
     */
    public static function apply(Builder $builder, $value)
    {
        return $builder->whereHas('owner', function($query) use ($value) {
            $query->where('reference', 'LIKE', '%' . $value . '%');
        });
    }
}
