This is probably a simple fix... but I can't get validation to work.
I've simplified my test back to this...
$input = array(
'name' => ''
);
$rules = array(
'name' => 'required|min:3|max:50|alpha'
);
$v = Validator::make($input, $rules);
And even though 'name' is required and has all the other rules the validator doesn't contain any errors.
dd($v->errors); // returns NULL
However
dd($v->fails()); // returns bool(true)
Why are there no error messages? When I dump the whole $v object there are no messages to be seen anywhere. Very confused... help appreciated. Thanks.
---- edit
I've simplified this even further. I've put this directly in a view to test...
<?php
$input = array(
'name' => ''
);
$rules = array(
'name' => 'required'
);
$v = Validator::make($input, $rules);
dd($v);
?>
I still get exactly the same problem?
Here is the $v object
object(Laravel\Validator)#32 (9) {
["attributes"]=>
array(1) {
["name"]=>
string(0) ""
}
["errors"]=>
NULL
["rules":protected]=>
array(1) {
["name"]=>
array(1) {
[0]=>
string(8) "required"
}
}
["messages":protected]=>
array(0) {
}
["db":protected]=>
NULL
["bundle":protected]=>
string(11) "application"
["language":protected]=>
NULL
["size_rules":protected]=>
array(4) {
[0]=>
string(4) "size"
[1]=>
string(7) "between"
[2]=>
string(3) "min"
[3]=>
string(3) "max"
}
["numeric_rules":protected]=>
array(2) {
[0]=>
string(7) "numeric"
[1]=>
string(7) "integer"
}
}
Is something in my installation/setup broken?