lundi 25 décembre 2017

laravel custom validation for array and passing parameter

I was doing some validation similar to this

$validator = Validator::make($request->all(), [
    'person.*.code' => 'unique_code:person.*.division',
]);


Validator::extend('unique_code', function ($attribute, $value, $parameters, $validator) {
            dd($parameters);
            return $value == 'foo';
        },'Duplicate Code');

but when i dump parameters i get 'person.*.division' but not the value of person[index]['division]



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2pxOJgy
via IFTTT

Aucun commentaire:

Enregistrer un commentaire