I've an owners
table with a user_id
field, this field can be NULL
. because not every owner may have an user account. I need to check if the user_id
field is NUL
L on the owners
table, before creating a user and updating that table. How do I do it with Laravel's Validation ?
You can extend the validator, as per the docs
Validator::extend('foo', function($attribute, $value, $parameters)
{
return $value == NULL;
});
See the custom validation section http://four.laravel.com/docs/validation