vendredi 10 février 2017

Laravel :values placeholder not working?

I've created a custom validator for extensions:

Validator::extend('extension', function ($attribute, $file, $extensions, $validator) {
    $ext = strtolower(@$file->getClientOriginalExtension());

    return in_array($ext, $extensions);
});

And the custom message:

'extension' => 'The :attribute must be a file of type: :values.',

It doesn't seem to replace the :values part.

I've tried using the custom replace also without luck:

Validator::replacer('wtf', function ($message, $attribute, $rule, $parameters) {
    return 'show me something!!!!!';
});

But this doesn't do anything either.

What's missing?



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

Aucun commentaire:

Enregistrer un commentaire