<?php
/**
 * Created by PhpStorm.
 * User: radko
 * Date: 2019-02-07
 * Time: 14:11
 */

namespace Seka\Portal\Modul\Vzdelavanie\Repositories\Eloquent\Filters;

use Illuminate\Database\Eloquent\Builder;
use Spatie\QueryBuilder\Filters\Filter;

/**
 * Class LimitFilter
 *
 * @package Seka\Portal\Modul\Vzdelavanie\Repositories\Eloquent\Filters
 */
class LimitFilter implements Filter
{
    /**
     * @param \Illuminate\Database\Eloquent\Builder $query
     * @param                                       $value
     * @param string                                $property
     *
     * @return \Illuminate\Database\Eloquent\Builder
     */
    public function __invoke(Builder $query, $value, string $property): Builder
    {
        return $query->limit($value);
    }
}
