captcha
captcha copied to clipboard
Automatically add captcha route is a bad idea
The CaptchaServiceProvider adds a captcha route for the whole app, I think the routing work should be done by developers.
i have the same view
yaaaap, this is really bad idea
A solution: override the service provider.
<?php
namespace App\Providers;
use Mews\Captcha\CaptchaServiceProvider as ServiceProvider;
class CaptchaServiceProvider extends ServiceProvider
{
/**
* Override the Captcha service provider to remove the default routing.
*/
public function boot()
{
$this->publishes([
base_path('vendor/mews/captcha/config/captcha.php') => config_path('captcha.php'),
], 'config');
$this->app['validator']->extend('captcha', function ($attribute, $value, $parameters) {
return captcha_check($value);
});
}
}
Then, replace the provider Mews\Captcha\CaptchaServiceProvider::class with App\Providers\CaptchaServiceProvider::class in config/app.php file.
This repo seems to be suspended, I created a patched package https://github.com/ElfSundae/laravel-captcha 😄