Intervention\Validation\ValidationServiceProviderLaravel5::boot PHP Method

boot() public method

Bootstrap the application events.
public boot ( ) : void
return void
    public function boot()
    {
        // load translation files
        $this->loadTranslationsFrom(__DIR__ . '/../../lang', 'validation');
        // registering intervention validator extension
        $this->app['validator']->resolver(function ($translator, $data, $rules, $messages, $customAttributes) {
            // set the validation error messages
            foreach (get_class_methods('Intervention\\Validation\\Validator') as $method) {
                $key = $this->getTranslationKeyFromMethodName($method);
                $messages[$key] = $this->getErrorMessage($translator, $messages, $key);
            }
            return new ValidatorExtension($translator, $data, $rules, $messages, $customAttributes);
        });
    }