EscolaLMS/Core

View on GitHub
src/Repositories/Criteria/Primitives/LikeCriterion.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php


namespace EscolaLms\Core\Repositories\Criteria\Primitives;

use EscolaLms\Core\Repositories\Criteria\Criterion;
use Illuminate\Database\Eloquent\Builder;

class LikeCriterion extends Criterion
{
    public function apply(Builder $query): Builder
    {
        return $query->where($this->key, 'LIKE', "%$this->value%");
    }
}