Skip to content

Validators do not get added due to deferred service provider #14

@hackel

Description

@hackel

I just upgraded from 0.5.2 and discovered that the validations no longer work, throwing a BadMethodCallException: Method Illuminate\Validation\Validator::validateCca2 does not exist. I discovered that the validator extensions were not being loaded at all, and traced that back to the service provider now being deferred.

As a workaround, I just added app('pragmarx.countries'); to my own AppServiceProvider to manually resolve the provider on every request, which then registers the validator extensions, and everything is happy again.

I'm not sure of the best solution to this issue. Perhaps it would be best to convert the validation extensions to Rule objects that will resolve the provider when needed without having to disable deferred loading all together.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions