Skip to content

Instantly share code, notes, and snippets.

@helmerdavila
Created November 6, 2015 06:05
Show Gist options
  • Save helmerdavila/9d78794f83dec3e2884b to your computer and use it in GitHub Desktop.
Save helmerdavila/9d78794f83dec3e2884b to your computer and use it in GitHub Desktop.
Validador Cadena con espacios Laravel
<?php
// Colocar en AppServiceProvider o en Provider a gusto
Validator::extend('alpha_spaces', function($attribute, $value)
{
return preg_match('/^[\pL\s]+$/u', $value);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment