File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 7
7
8
8
trait HasTracking
9
9
{
10
- private const FBC_COOKIE_NAME = '_fbc ' ;
10
+ private string $ fbcCookieName = '_fbc ' ;
11
+
12
+ private string $ fbpCookieName = '_fbp ' ;
11
13
12
- private const FBP_COOKIE_NAME = '_fbp ' ;
13
-
14
- private const COOKIE_LIFETIME = 7776000 ; // 90 days in seconds
14
+ private int $ cookieLifetime = 7776000 ; // 90 days in seconds
15
15
16
16
public function handleTracking (Request $ request ): void
17
17
{
@@ -25,15 +25,15 @@ private function handleFbc(Request $request): void
25
25
26
26
if ($ fbclid ) {
27
27
$ formattedFbc = $ this ->formatFbc ($ fbclid );
28
- Cookie::queue (self :: FBC_COOKIE_NAME , $ formattedFbc , self :: COOKIE_LIFETIME );
28
+ Cookie::queue ($ this -> fbcCookieName , $ formattedFbc , $ this -> cookieLifetime );
29
29
}
30
30
}
31
31
32
32
private function handleFbp (Request $ request ): void
33
33
{
34
- if (! $ request ->cookie (self :: FBP_COOKIE_NAME )) {
34
+ if (! $ request ->cookie ($ this -> fbcCookieName )) {
35
35
$ formattedFbp = $ this ->generateFbp ();
36
- Cookie::queue (self :: FBP_COOKIE_NAME , $ formattedFbp , self :: COOKIE_LIFETIME );
36
+ Cookie::queue ($ this -> fbpCookieName , $ formattedFbp , $ this -> cookieLifetime );
37
37
}
38
38
}
39
39
You can’t perform that action at this time.
0 commit comments