/** * Bootstrap the application services. * * @return void */ public function boot() { // Publish configuration files $this->publishes([__DIR__ . '/../config/captcha.php' => config_path('captcha.php')], 'config'); // HTTP routing $this->app['router']->get('captcha', '\\Hamog\\Captcha\\CaptchaController@getCaptcha')->middleware('web'); // Validator extensions $this->app['validator']->extend('captcha', function ($attribute, $value, $parameters) { return \Captcha::check($value); }); }
/** * Get captcha image * * @param Captcha $captcha */ public function getCaptcha(Captcha $captcha) { return $captcha->create(); }