<?php

namespace App\Core\Validator\PropertyWebContent;

use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Translation\Translator;
use Exception;
use App\Core\Validator\BaseValidator;

class PropertyWebContentCreateValidator extends BaseValidator
{

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

    public function rules($params = null)
    {
        return
            [
                "property_id" => 'required|numeric',
                "content_category_id" => 'required|numeric',
                "title" => 'required|min:2|max:250',
                "language_code" => 'required|min:2|max:10',
                "image" => 'nullable',
                "content" => 'nullable',
            ];
    }

    public function messages()
    {
        $thisMessages =
            [
                "checkDomain.accepted" => "This domain added before",
                "hasDomain.accepted" => "This property have added other domain before",
                "isValidDomain.accepted" => "Not validate domain name.",
            ];
        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());
    }

}
