<?php
/**
 * Created by PhpStorm.
 * User: radko
 * Date: 2019-02-07
 * Time: 14:11
 */
namespace Seka\Vzdelavanie\Repositories\Eloquent\Filters;

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

/**
 * Class LimitFilter
 * @package Seka\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);
    }
}
