We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using the ipinfo configuration in Laravel 10 with a custom IP selector object, the php artisan config:cache command fails, throwing the error:
ipinfo
Laravel 10
php artisan config:cache
LogicException Your configuration files are not serializable. at vendor\laravel\framework\src\Illuminate\Foundation\Console\ConfigCacheCommand.php:73
The root cause is the direct instantiation of CustomIPSelector in the configuration array, as shown
CustomIPSelector
'ipinfo' => [ 'access_token' => env('IPINFO_SECRET'), 'ip_selector' => new CustomIPSelector(), 'filter' => false, 'no_except' => true, ],
Steps to Reproduce:
LogicException Your configuration files are not serializable.
Workaround Attempt: Replacing the instantiation with the class name works for php artisan config:cache:
'ipinfo' => [ 'access_token' => env('IPINFO_SECRET'), 'ip_selector' => App\Helpers\CustomIPSelector::class, 'filter' => false, 'no_except' => true, ],
However, this leads to another error when using the ipinfo library:
Call to a member function getIP() on string
This happens because the library directly uses the ip_selector configuration value without instantiating the class.
ip_selector
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When using the
ipinfo
configuration inLaravel 10
with a custom IP selector object, thephp artisan config:cache
command fails, throwing the error:The root cause is the direct instantiation of
CustomIPSelector
in the configuration array, as shownSteps to Reproduce:
php artisan config:cache
.Workaround Attempt:
Replacing the instantiation with the class name works for
php artisan config:cache
:However, this leads to another error when using the
ipinfo
library:This happens because the library directly uses the
ip_selector
configuration value without instantiating the class.The text was updated successfully, but these errors were encountered: