mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 04:20:49 +08:00
feat(admin): manage captcha configuration centrally
- add a dedicated Filament settings tab for captcha drivers - persist selections into config-compatible schema and migrate legacy keys - extend captcha manager to consume database overrides transparently Signed-off-by: Qi HU <github@spcsky.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Services\Captcha;
|
||||
|
||||
use App\Services\Captcha\Exceptions\CaptchaValidationException;
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class CaptchaManager
|
||||
@@ -113,6 +114,15 @@ class CaptchaManager
|
||||
}
|
||||
|
||||
$this->config = is_array($config) ? $config : [];
|
||||
|
||||
try {
|
||||
$settings = Setting::get('captcha', []);
|
||||
if (is_array($settings) && !empty($settings)) {
|
||||
$this->config = array_replace_recursive($this->config, $settings);
|
||||
}
|
||||
} catch (\Throwable $exception) {
|
||||
// ignore database errors at bootstrap phase
|
||||
}
|
||||
}
|
||||
|
||||
return Arr::get($this->config, $key, $default);
|
||||
|
||||
Reference in New Issue
Block a user