<?php

namespace App\Http\Requests\Backend;

use Illuminate\Foundation\Http\FormRequest;

class UserAddressRequest 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()
    {
        switch ($this->method()) {
            case 'POST':
            case 'PUT':
            case 'PATCH':
            {
                return [
                    //"customer_id" => ['required'],
                    'title' => ['required',"max:1000"],
                    'default' => ['required',"max:1000"],
                    'contact_full_name' => ['required','string'],
                    'contact_email' => ["nullable",'string', 'email'],
                    'contact_phone' => ["nullable",'string'],
                    'address' => ["nullable",'string'],
                    'address2' => ["nullable",'string'],
                    'country_id' => ['required'],
                    'state_id' => ['required'],
                    'city_id' => ['required'],
                    'quarter_id' => ['nullable'],
                    'zip_code' => ['nullable'],
                    'po_box' => ['nullable'],
                ];
            }
            default: break;
        }

    }
}
