opened
alfonsobries
username_0
- Laravel Version: 5.7
- PHP Version: 7.2
- Database Driver & Version: mysql

### Description:
I'm trying to create a custom validation rule or at least use a closure custom validation but I cannot achieve that the function was called when the request value is empty.

### Steps To Reproduce:

1. Create a closure validation rule
2. Send an empty attribute
3. The function is ignored

Example:
```
$this->validate($request->all(), [
	'users.email' => function($attribute, $value, $fail) {
			dd("This is not called when the $value (user[0].email = '') is empty");
			// My custom condition for example only require email if the user is admin
			// ....
    }
]);
```
Custom rules and Closures are not called if value is empty
issue
created
alfonsobries
username_0
btw i create this PR that is useful to solve this kind of rules:
https://github.com/laravel/framework/pull/25066
comment
created
alfonsobries
username_0
I find that i need to use the extendImplicit function this solves my problem 
Validator::extendImplicit('foo', function ($attribute, $value, $parameters, $validator) {
    return $value == 'foo';
});

Its possible to achieve using validation closures?
comment
closed
alfonsobries
username_0
issue
created
surgiie
username_1
@username_0 same issue here. Wondering why it doesnt call when the request input is empty.
comment