session() ->csrf(); // Register all Analytics cookies at once using one single shorthand method: // Cookies::analytics() // ->google( // id: config('cookieconsent.google_analytics.id'), // anonymizeIp: config('cookieconsent.google_analytics.anonymize_ip') // ); // Register custom cookies under the pre-existing "optional" category: // Cookies::optional() // ->name('darkmode_enabled') // ->description('This cookie helps us remember your preferences regarding the interface\'s brightness.') // ->duration(120) // ->accepted(fn(Consent $consent, MyDarkmode $darkmode) => $consent->cookie(value: $darkmode->getDefaultValue())); } }