<?php
/**
 * Created by PhpStorm.
 * User: UNTREF
 * Date: 13/10/2017
 * Time: 10:36 AM
 */

namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request;

class ChangePasswordRequest extends FormRequest
{

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

    /**
     * @return array
     */
    public function rules(Request $request)
    {

        if($request){


            return [

                'password' => 'required|min:4',
                'password_confirmation' => 'required|min:4',
                'password_confirmation2' => 'required|min:4',
            ];

        }
    }

    public function messages()
    {
        return [
            'password.required' => ' Ingrese su contraseña actual.',
            'password_confirmation.required' => 'El campo Nueva Contraseña es requerido.',
            'password_confirmation2.required' => 'El campo Confirmar Contraseña es requerido.',
            'password_confirmation.min' => 'Nueva Contraseña ingrese 4 caracteres mínimo.',

        ];
    }

    /**
     * Get the sanitized input for the request.
     *
     * @return array
     */
//    public function sanitize()
//    {
//        return $this->only('token');
//    }

}