Boy132 9d02aeb130
Replace reCAPTCHA with Turnstile (#589)
* add laravel turnstile

* add config & settings for turnstile

* publish view to center captcha

* completely replace reCAPTCHA

* update FailedCaptcha event

* add back config for domain verification

* don't set language so browser lang is used
2024-11-01 18:15:04 -04:00

35 lines
973 B
PHP

<?php
namespace App\Http\ViewComposers;
use App\Services\Helpers\AssetHashService;
use Illuminate\View\View;
class AssetComposer
{
/**
* AssetComposer constructor.
*/
public function __construct(private AssetHashService $assetHashService)
{
}
/**
* Provide access to the asset service in the views.
*/
public function compose(View $view): void
{
$view->with('asset', $this->assetHashService);
$view->with('siteConfiguration', [
'name' => config('app.name', 'Panel'),
'locale' => config('app.locale') ?? 'en',
'recaptcha' => [
'enabled' => config('turnstile.turnstile_enabled', false),
'siteKey' => config('turnstile.turnstile_site_key') ?? '',
],
'usesSyncDriver' => config('queue.default') === 'sync',
'serverDescriptionsEditable' => config('panel.editable_server_descriptions'),
]);
}
}