Hi
In Laravel 4 this code works like a charm. But in Laravel 4.1 this don't work.
start/global.php
require app_path().'/validators.php';
validators.php
<?php
// Crear validación de alpha espacios
Validator::extend('alpha_spaces', function($attribute, $value, $parameters)
{
return preg_match('/^[\pL\s]+$/u', $value);
});
UsersController
.....
$reglas = array(
'first_name' => 'required|alpha_spaces|min:3|max:30',
'last_name' => 'required|alpha_spaces|min:3|max:30',
'email' => 'required|email|unique:users,email',
'password' => 'required|confirmed'
);
And the lenguage file (same for alpha)
I put in the form (first_name and/or last_name) any simple word (for example: laravel) and the validation fails: "The first name may only contain letters and numbers". The question is. WHY?
Thanks
Offtopic: I don't like this new forum format. Force to login with github? Tags?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community