anhskohbo / no-captcha

No CAPTCHA reCAPTCHA For Laravel.
https://packagist.org/packages/anhskohbo/no-captcha
MIT License
1.77k stars 234 forks source link

config secret and sitekey #110

Closed deniztezcan closed 6 years ago

deniztezcan commented 6 years ago

Heya!

I'm working on a application which server multiple different sites and can not use a single key for all (over 50+). Is it possible to use multiple different keys and if so please explain how :)

anhskohbo commented 6 years ago

I'm not sure this help but you can publish the config file then provide option depend by current site.

php artisan vendor:publish --provider="Anhskohbo\NoCaptcha\NoCaptchaServiceProvider"
<?php

return [
    'secret' => get_option('nocaptcha_secret', current_site()),
    'sitekey' => get_option('nocaptcha_sitekey', current_site()),
    'options' => [
        'timeout' => 2.0,
    ],
];
deniztezcan commented 6 years ago

Can you provide some more info on the "current_site()" function?

anhskohbo commented 6 years ago

I'm not sure your app is multisites in a single source (like WordPress multisite) or multi source.

But basically my idea you need a get_option( $key, $site_name_or_id) function to retrieve option in each single site.