thinhbuzz / laravel-google-captcha

Google captcha for Laravel 5, Laravel 6, Laravel 7, Laravel 8, Laravel 9 and Laravel 10, support multiple captcha on page
MIT License
200 stars 32 forks source link

L5.1 Call to undefined method Closure::__set_state() #22

Closed devtac-agarcia closed 6 years ago

devtac-agarcia commented 6 years ago

Hi guys,

I'm working on laravel 5.1 and after updating the laravel-google-captcha to v2.1.6, I got an error on running php artisan command image I checked the bootstrap/cache/config.php and I got the code below: image

Not sure what's wrong. Please advise.

Thanks and regards!

thinhbuzz commented 6 years ago

please show captcha config

devtac-agarcia commented 6 years ago

Hi @thinhbuzz ,

Here's the code in vendor/buzz/laravel-google-captcha/config/config.php file, also I can confirm the \ReCaptcha\RequestMethod\Post does exist image

Regards!

thinhbuzz commented 6 years ago

you can try clear cache with command: php artisan config:clear php artisan clear-compiled php artisan cache:clear

devtac-agarcia commented 6 years ago

Hi @thinhbuzz ,

It works if I deleted the bootstrap/cache/config.php file using php artisan config:clear command. But is there any way to retain the bootstrap/cache/config.php file?

I believe the error is the get_request_method key which has Closure::__set_state value.

// bootstrap/cache/config.php
'captcha' => 
  array (
    'secret' => '<secret-here>',
    'sitekey' => '<sitekey-here>',
    'get_request_method' => 
    Closure::__set_state(array(
    )),
  ),

Thanks!

thinhbuzz commented 6 years ago

ok, i see ConfigCacheCommand.php#L56 use var_export and this function cannot keep function

thinhbuzz commented 6 years ago

issue fixed in commit 09c1f82132967c6d21682eb8806366f43bd414fd please update package to 2.1.7

devtac-agarcia commented 6 years ago

Thank you @thinhbuzz :+1: