<?php

namespace App\Criteria;

use Prettus\Repository\Contracts\CriteriaInterface;
use Prettus\Repository\Contracts\RepositoryInterface;

/**
 * Class LeadCriteria.
 *
 * @package namespace App\Criteria;
 */
class LeadCriteria extends BaseCriteria implements CriteriaInterface
{
    /**
     * Apply criteria in query repository
     *
     * @param string $model
     * @param RepositoryInterface $repository
     *
     * @return mixed
     */
    protected $user_id = null;

    public function apply($model, RepositoryInterface $repository)
    {
//        dd($this->user_id);
        if ($this->isset('user_id')) {
            $model = $model->where('user_id', $this->user_id);
//            $model = $model->where('user_id', Null);

        }
//        dd($model);
        return $model;
    }

}
