I am facing a problem with laravel custom validation message, here is what I have:
$rules = [
\'first_name\' => \'required|alpha|min:2\',
Here is the way to do it , just instead of using 'regex' , use 'phone.regex'
$rules = [
'first_name' => 'required|alpha|min:2',
'last_name' => 'required|alpha|min:2',
'email' => 'required|email|unique:users,email,' . Input::get('id') . ',id',
'password' => 'alpha_num|between:6,12|confirmed',
'password_confirmation' => 'alpha_num|between:6,12',
'address' => 'regex:/^[a-z0-9- ]+$/i|min:2',
'city' => 'alpha|min:2',
'state' => 'alpha|min:2|max:2',
'zip' => 'numeric|min:5|max:5',
'phone' => 'regex:/^\d{3}\-\d{3}\-\d{4}$/',
];
$messages = [
'unique' => 'The :attribute already been registered.',
'phone.regex' => 'The :attribute number is invalid , accepted format: xxx-xxx-xxxx',
'address.regex' => 'The :attribute format is invalid.',
];