Skip to content

Releases: scify/laravel-cookie-guard

v4.1.7 - Bugfixes & Improvements

21 Aug 07:12

Choose a tag to compare

  • Fixed the issue with the undefined $accordionHeader in the cookie consent dialog.
  • Added dev-related tools (linter, prettier, etc)
  • Updated dependencies to their latest versions.

v4.1.6 - Failsafe JSON parsing

07 Jul 12:26

Choose a tag to compare

v4.1.6 Failsafe JSON parsing

v4.1.5 - UI fix for Safari Browser

07 Jul 05:36

Choose a tag to compare

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

06 Jun 06:58

Choose a tag to compare

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 heading and accordion-heading attribute 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 h2 for heading and h5 for accordion-heading, if not specified.

  • The cookie consent banner can now also be opened by navigating to the #consent-settings hash 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

14 Apr 07:20

Choose a tag to compare

v4.1.3 - UI Improvements

  • Fixed modal centering on some screens
  • Improved docs

v4.1.2 - Fixed Back Scrolling & Button focus

06 Apr 06:29

Choose a tag to compare

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

03 Apr 07:49

Choose a tag to compare

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:

  1. 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.

  2. 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.

  3. 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.

v4.0.1 - Fixed z-index and improved layout

14 Mar 08:10

Choose a tag to compare

v4.0.1 - Fixed z-index and improved layout

v4.0.0 - Multilingual Support & Better Theming

07 Mar 10:27

Choose a tag to compare

v4.0.0 - Multilingual Support & Better Theming - Breaking Changes in Configuration and Functionality - 2025-03-07

The plugin is now renamed to laravel-cookie-guard and has undergone some major updates! 🎉🥳😍

Important:
Since the plugin now has a completely new name, you will need to uninstall the old package, and install the new one.

rm -rf public/vendor/scify && rm -rf vendor/scify

composer remove scify/laravel-cookies-consent

composer require scify/laravel-cookie-guard

php artisan vendor:publish --provider="SciFY\LaravelCookiesConsent\LaravelCookiesConsentServiceProvider" --tag="cookies-consent-public" --force

Then, make sure to check the configuration file config/cookies_consent.php and update it according to the new one.

Then, make sure that the Laravel components you use are the new ones:

Intead of using:

<x-laravel-cookies-consent></x-laravel-cookies-consent>

Use:

<x-laravel-cookie-guard-scripts></x-laravel-cookie-guard-scripts>
<x-laravel-cookie-guard></x-laravel-cookie-guard>

Introduction

In order to conform with the European Union's General Data Protection Regulation (GDPR) and improve the user experience,
the Laravel Cookies Consent plugin has undergone a major update. This release includes a multi-language support in the
banner, in order to allow the banner to change when the locale is changed. The plugin now supports multiple languages
in all the texts that are displayed to the user!

Also, in order to improve the flexibility and theming of the plugin, we now provide a _variables.css file, which can
be used to customize the colors and fonts of the plugin. This file is located in the
public/vendor/scify/laravel-cookie-guard/styles directory and can
be customized to match the design of your application.

New Features

  • Multi-Language Support: The plugin now supports multiple languages in the banner and the cookies consent modal.
    The texts displayed to the user can be translated based on the locale set in the application. By default, all 24
    languages of the EU are supported.
  • Automatic locale detection: The plugin automatically detects the app's locale based on the Laravel locale, and
    displays the banner in the corresponding language.
  • Customizable Theme: A _variables.css file is now being added to the
    public/vendor/scify/laravel-cookie-guard/styles
    directory, once you publish the front-end assets. This file can be used to customize the colors and fonts of the
    plugin to match the design of your
    application.
  • Cookies categories collapsed by default: The cookies categories are now collapsed by default in the cookies
    consent modal. Users can expand each category to view the cookies included in that category. This can be tweaked in
    the config/cookies_consent.php file.
  • Improved UI/UX: The cookies consent modal has been updated with improved styling and layout for a better user
    experience.

How to override the CSS styles

If you want to override the CSS styles of the cookies consent dialog, you can do this:

<x-laravel-cookie-guard></x-laravel-cookie-guard>
<style>
    #scify-cookies-consent {
        --scify-cookies-primary-color: #ff5722; /* Override primary color */

        ...

        /* Add more override rules here */
    }
</style>

The full list of CSS variables that can be overridden can be found in the
public/vendor/scify/laravel-cookie-guard/_variables.css file.

Breaking Changes

The v4.0.0 release introduces significant changes to the config/cookies_consent.php configuration file.
These changes are necessary to improve the flexibility and usability of the plugin. Below
are the details of the changes and the steps required to update your existing configuration.

Configuration File Changes

Cookie Categories:

The structure of the cookies array has been updated to reflect the new multi-language support.
Each cookie now has their description derived from the language files, based on the locale set in the application.

Cookie Duration:

Each cookie category now includes a description, duration, and duration_count attributes.
For example, if you want to set the duration of a cookie to 2 years, you can set the duration to
cookies_consent::messages.years and the duration_count to 2.
The plugin will automatically translate the duration text, based on the locale set in the application.

Cookies categories collapsed by default:

The cookies categories are now collapsed by default in the cookies consent modal. Users can expand each category to view
the cookies included in that category. This can be tweaked in the config/cookies_consent.php file, in the
categories_collapsed_by_default key.

Migration Guide

  1. Backup your existing configuration file: Before updating to the new version, make sure to take a backup of your
    existing
    config/cookies_consent.php file to avoid losing any custom settings.
  2. Update the Configuration File: Run
    php artisan vendor:publish --provider="SciFY\LaravelCookiesConsent\LaravelCookiesConsentServiceProvider" --tag=cookies-consent-config --force
    and then ensure the cookie_prefix is set in the config/cookies_consent.php file. Update
    the
    description, duration, and duration_count fields of each cookie in the cookies array to reflect the new
    JSON
    storage format.
  3. Publish the Front-End Assets: Run the following command to publish the updated assets:
    php artisan vendor:publish --provider="SciFY\LaravelCookiesConsent\LaravelCookiesConsentServiceProvider" --tag="cookies-consent-public" --force
  4. Build the Laravel configuration cache: Run the following command to rebuild the configuration cache:
    php artisan config:cache
  5. Test Your Application: Ensure that the cookies consent functionality works as expected with the new JSON storage
    format. Verify that the cookies are correctly set and retrieved in the browser.

v3.1.4 - UI improvements & fixes

14 Feb 08:19

Choose a tag to compare

  • Fixed the SCSS variable declaration for --bs-accordion-border-color
  • Improved the default font family to ensure a universal style
  • Fixed some font sizes