<?php

declare(strict_types=1);

namespace App\Repositories\Eloquent\Criteria;

use Illuminate\Database\Eloquent\Builder;
use Prettus\Repository\Contracts\CriteriaInterface;
use Prettus\Repository\Contracts\RepositoryInterface;

/**
 * Class OrderByCasZverejneniaAscCriteria
 */
final class OrderByCasZverejneniaAscCriteria implements CriteriaInterface
{
    /**
     * @param  \Illuminate\Database\Eloquent\Builder  $model
     */
    public function apply($model, RepositoryInterface $repository): Builder
    {
        $model = $model->orderBy('cas_zverejnenia');

        return $model;
    }
}
