cn-cookies Blade fix usage with php8.2

This commit is contained in:
Jérémy Munsch 2023-10-10 11:13:16 +00:00
parent 2deb913f43
commit d39b207ef0

View file

@ -1,3 +1,4 @@
{{-- blade-formatter-disable --}}
@php
$site_name = Str::ucfirst(config('app.name'));
@ -138,6 +139,7 @@ function () {
SCRIPT;
// ANALYCTICS
$analyticKey = config('services.google.analytics.id');
$cookies['analytics'] = [
'name' => __('MESURES D’AUDIENCE') . ' - Google Analytics',
'description' => __('Les cookies qui sont déposés via le recaptcha sur les formulaires ont pour finalité d’empêcher que ceux-ci ne soient soumis par des robots.'),
@ -145,7 +147,7 @@ $cookies['analytics'] = [
'labelLink' => __('En savoir +'),
'cookies' => [
'_ga',
'_gat_gtag_' . str_replace("-", "_", config("ldcweb-cookies.analyticsKey")),
'_gat_gtag_' . str_replace("-", "_", $analyticKey),
'_gid'
]
];
@ -155,7 +157,7 @@ function () {
(function (d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src = 'https://www.googletagmanager.com/gtag/js?id={{ config("ldcweb-cookies.analyticsKey") }}';
g.src = 'https://www.googletagmanager.com/gtag/js?id={$analyticKey}';
g.id = 'analytics';
s.parentNode.insertBefore(g, s)
}(document, 'script'));
@ -167,7 +169,7 @@ function () {
}
gtag('js', new Date());
gtag('config', '{{ config("ldcweb-cookies.analyticsKey") }}');
gtag('config', '{$analyticKey}');
}
SCRIPT;
@endphp