jeudi 12 mars 2020

How to validate that a parameter is an instance of a given class in Laravel?

What json should I pass in request to pass this validation? Here is the document: enter image description here

and here is the code

public function passes($attribute, $value)
{
    return $value instanceof $this->enumClass;
}

https://github.com/BenSampo/laravel-enum



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire