Releases: scify/laravel-cookie-guard
v4.1.11 - Bug fixes & files inclusion
v4.1.11
Bug Fixes
Fixed conflict with lodash and other libraries using _ global
The minified JavaScript output was previously not wrapped in an IIFE (Immediately Invoked Function Expression), causing internal variables to leak into the global scope. The minifier assigned the name _ to an internal function, which overwrote
window._ when lodash was present in the consuming application.
The Vite build configuration now outputs the JavaScript in IIFE format, ensuring all internal variables remain scoped within a closure and don't pollute the global namespace.
Improvements
Included documentation in Composer distribution
README.md is now included when installing via Composer. This helps developers and AI coding assistants (Claude, Copilot, Cursor, etc.) access documentation directly from vendor/scify/laravel-cookie-guard/ without needing to visit GitHub.
CLAUDE.md continues to be included, providing detailed codebase context for AI-assisted development.
Solves #57
Added JavaScript build output tests
New automated tests verify the compiled JavaScript:
- Wrapped in IIFE to prevent global scope pollution
- No global _ function that could conflict with lodash
- Public API (window.toggleCookieBanner) correctly exposed
- Strict mode enabled
Run with npm test.
v4.1.9 - Cookies Scripts Cache Bust
cookies scripts cache bust
v4.1.8 - Bugfix on setting & getting cookies
cookies setting & getting bugfix
v4.1.7 - Bugfixes & Improvements
- Fixed the issue with the undefined
$accordionHeaderin the cookie consent dialog. - Added dev-related tools (linter, prettier, etc)
- Updated dependencies to their latest versions.
v4.1.6 - Failsafe JSON parsing
v4.1.6 Failsafe JSON parsing
v4.1.5 - UI fix for Safari Browser
v4.1.5 - Fixed the issue with the cookie consent dialog overflow in Safari
v4.1.4 - Customizable Heading Level for Dialog & Opening by hash
v4.1.4 - Customizable Heading Level for Dialog & Opening by hash
-
Added the ability to customize the heading level of the cookie consent dialog title and the accordion headings via the
headingandaccordion-headingattribute on the<x-laravel-cookie-guard>component. -
This allows developers to specify the semantic heading tag (e.g.,
h2,h3, etc.) for better accessibility and SEO integration with their application's heading structure. -
Example usage:
<x-laravel-cookie-guard heading="h2" accordion-heading="h5"/>
-
The default heading level is now
h2forheadingandh5foraccordion-heading, if not specified. -
The cookie consent banner can now also be opened by navigating to the
#consent-settingshash in the URL. The banner will open automatically on page load or when the hash changes to#consent-settings.
Example usage:<div> <a href="#consent-settings">Cookies Preferences</a> </div>
v4.1.3 - UI Improvements
v4.1.3 - UI Improvements
- Fixed modal centering on some screens
- Improved docs
v4.1.2 - Fixed Back Scrolling & Button focus
v4.1.2 - Fixed Back Scrolling & Button focus
- Fixed the issue with the back scrolling of the page when the cookies consent modal is open.
- Fixed the issue with the button focus in Safari.
v4.1.1 - Ability to have a fully-accessible dialog
v4.1.1 - Improved Accessibility & Bug Fixes - 2025-04-03
We have decided to give the developers the ability to use the pure <dialog> HTML element functionality for our cookie
consent component to enhance accessibility and ensure compliance with privacy regulations.
The <dialog> element is designed to create a modal dialog that captures the user's focus, preventing interaction with
the rest of the webpage
until the dialog is dismissed.
This approach ensures that users must make a choice regarding cookie consent before they
can continue using the website. Read more here.
By using the <dialog> element, we achieve the following benefits:
-
Improved Accessibility: The
<dialog>element is natively supported by modern browsers and provides built-in
accessibility features. It ensures that screen readers and other assistive technologies can properly announce the
dialog and its contents to users with disabilities. -
Focus Management: When the dialog is open, it automatically captures the focus, preventing users from navigating
outside of it. This ensures that users cannot interact with other parts of the website until they have accepted or
rejected the cookies, making the consent process clear and unavoidable. -
Compliance with Privacy Regulations: By requiring users to make a choice before continuing to use the website, we
ensure compliance with privacy regulations such as the GDPR. This approach guarantees that users are informed about
and consent to the use of cookies before any data is collected.
Overall, the use of the <dialog> element enhances the user experience by providing a clear and accessible way to
manage cookie consent, ensuring that all users can interact with our website in a compliant and user-friendly manner.
This functionality is now the default behavior of the plugin, and it can be disabled by setting the new use_floating_modal flag in the config/cookies_consent.php file to true.