App\Providers\ValidationServiceProvider::boot PHP Method

boot() public method

public boot ( )
    public function boot()
    {
        Validator::extend('enum', function ($attribute, $value, $parameters) {
            /** @var \App\Foundation\Enums\Enum $class */
            $class = $parameters[0];
            return $class::isValid($value);
        });
    }
ValidationServiceProvider