cn-cookies Blade fix usage with php8.2
This commit is contained in:
parent
2deb913f43
commit
d39b207ef0
1 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue