Skip to content

Instantly share code, notes, and snippets.

@kirkbushell
Created October 8, 2014 20:01
Show Gist options
  • Save kirkbushell/0a7477ad371b285554b9 to your computer and use it in GitHub Desktop.
Save kirkbushell/0a7477ad371b285554b9 to your computer and use it in GitHub Desktop.
Deferred service provider overloading other deferred provider objects
class ValidationServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
public function register()
{
$closure = function() {
$this->app['validator']->setPresenceVerifier(new DoctrinePresenceVerifier);
};
$closure->bindTo($this);
$this->app['events']->listen('Illuminate\Validation\ValidationServiceProvider', $closure);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment