<?php
namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

class UpdateDevelopersRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'max:192|required',
            'code' => 'max:192|required|unique:developers,code,' . $this->route('developer'),
            'description' => 'max:50000|required',
            'logotype_icon' => 'nullable|mimes:png,jpg,jpeg,gif',
            'banner' => 'nullable|mimes:png,jpg,jpeg,gif',
            'build' => 'numeric|min:0|max:999|nullable',
            'being_built' => 'numeric|min:0|max:999|nullable',
            'email' => 'email:rfc,dns,filter,spoof|max:45',
            'phone' => 'min:6|max:21|regex:/^(\s*)?(\+)?([- _():=+]*\d[- _():=+]?){6,21}(\s*)?$/',
            'main_page_priority' => 'numeric|min:0|max:10|nullable',
            'developer_page_priority' => 'numeric|min:0|max:10|nullable',
            'birthday' => 'nullable',
            'meta_title' => 'max:192',
            'meta_keywords' => 'max:5000',
            'meta_description' => 'max:8000',
            'seo_text' => 'max:25000',
            'facebook' => 'max:192',
            'youtube' => 'max:192',
            'site_link' => 'max:192',
            'city_id' => 'required',
        ];
    }
}
