@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | - 'disable' => env('CAPTCHA_DISABLE', !str_contains(env('APP_ENV', 'local'), 'prod')), |
|
| 4 | + 'disable' => env('CAPTCHA_DISABLE', ! str_contains(env('APP_ENV', 'local'), 'prod')), |
|
| 5 | 5 | 'characters' => ['2', '3', '4', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'm', 'n', 'p', 'q', 'r', 't', 'u', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'M', 'N', 'P', 'Q', 'R', 'T', 'U', 'X', 'Y', 'Z'], |
| 6 | 6 | 'default' => [ |
| 7 | 7 | 'length' => 9, |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | // Publish configuration files |
| 23 | 23 | $this->publishes([ |
| 24 | - __DIR__ . '/../config/captcha.php' => config_path('captcha.php') |
|
| 24 | + __DIR__.'/../config/captcha.php' => config_path('captcha.php') |
|
| 25 | 25 | ], 'config'); |
| 26 | 26 | |
| 27 | 27 | // HTTP routing |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } else { |
| 34 | 34 | /* @var Router $router */ |
| 35 | 35 | $router = $this->app['router']; |
| 36 | - if ((double)$this->app->version() >= 5.2) { |
|
| 36 | + if ((double) $this->app->version() >= 5.2) { |
|
| 37 | 37 | $router->get('captcha/api/{config?}', '\Mews\Captcha\CaptchaController@getCaptchaApi')->middleware('web'); |
| 38 | 38 | $router->get('captcha/{config?}', '\Mews\Captcha\CaptchaController@getCaptcha')->middleware('web'); |
| 39 | 39 | } else { |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | $validator = $this->app['validator']; |
| 47 | 47 | |
| 48 | 48 | // Validator extensions |
| 49 | - $validator->extend('captcha', function ($attribute, $value, $parameters) { |
|
| 49 | + $validator->extend('captcha', function($attribute, $value, $parameters) { |
|
| 50 | 50 | return config('captcha.disable') || ($value && captcha_check($value)); |
| 51 | 51 | }); |
| 52 | 52 | |
| 53 | 53 | // Validator extensions |
| 54 | - $validator->extend('captcha_api', function ($attribute, $value, $parameters) { |
|
| 54 | + $validator->extend('captcha_api', function($attribute, $value, $parameters) { |
|
| 55 | 55 | return config('captcha.disable') || ($value && captcha_api_check($value, $parameters[0], $parameters[1] ?? 'default')); |
| 56 | 56 | }); |
| 57 | 57 | } |
@@ -65,12 +65,12 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | // Merge configs |
| 67 | 67 | $this->mergeConfigFrom( |
| 68 | - __DIR__ . '/../config/captcha.php', |
|
| 68 | + __DIR__.'/../config/captcha.php', |
|
| 69 | 69 | 'captcha' |
| 70 | 70 | ); |
| 71 | 71 | |
| 72 | 72 | // Bind captcha |
| 73 | - $this->app->bind('captcha', function ($app) { |
|
| 73 | + $this->app->bind('captcha', function($app) { |
|
| 74 | 74 | return new Captcha( |
| 75 | 75 | $app['Illuminate\Filesystem\Filesystem'], |
| 76 | 76 | $app['Illuminate\Contracts\Config\Repository'], |