<?php

namespace App\Http\Requests;


class UpdateUser extends Request
{
    /**
     * 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()
    {
        $id = $this->route('id');
        return [
            'name'     => 'bail|required|max:30|min:2',
            'bio'      => 'max:100',
            'usga'     => 'numeric|between:0,50',
            'ball_age' => 'numeric|between:0,50',
            'bio'      => 'max:100',
        ];
    }

    public function messages()
    {
        return [
            'name.required'    => trans('api.NAME_REQUIRED'),
            'name.max'         => trans('api.NAME_TOO_LONG'),
            'name.min'         => trans('api.NAME_TOO_SHORT'),
            'bio.max'          => trans('api.PROFILE_TOO_LONG'),
            'usga.numeric'     => trans('api.WRITE_NUMBER'),
            'usga.between'     => trans('api.ZERO_50'),
            'ball_age.numeric' => trans('api.WRITE_NUMBER'),
            'ball_age.between' => trans('api.ZERO_50'),
        ];
    }
}
