<?php

namespace App\Core\Validator\Destination;


use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Translation\Translator;

use App\Core\Validator\BaseValidator;

use Exception;

class DestinationSearchValidator extends BaseValidator
{


    public function __construct
    (

        Translator $translator,
        Container $container
    )
    {
        parent::__construct($translator, $container);

    }

    public function rules($params = null)
    {
        return
            [
                'search_term' => 'required|min:3',
            ];

    }

    public function messages()
    {
        $thisMessages =
            [
                "search_term.required" => lang("search_term is required"),
                "search_term.min" => lang("search_term can be minimum 3 characters"),
            ];

        return array_merge(parent::messages() , $thisMessages);
    }


    public function validate(array $params, array $rules = [], array $messages = [], array $customAttributes = [])
    {

        return $this->make($params, $this->rules($params), $this->messages());
    }

}
