samedi 12 mars 2016

Validation issue in Laravel 5.2

I have below code.

public function rules()
{
    return [
        'PID' => 'required|integer|min:5|max:15|unique:tblproject,PID,'
                                              . \Request::get('ProjectID') . ',ProjectID',
    ];
}

public function messages() {
    return [
        'PID.min' => 'Invalid projectid. It should be numeric.'
    ];
}

I have a Textbox where I fill 12345 and on submit shows below validation.

The p i d may not be greater than 15.

Please guide me to right direction to fix it.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire