Download the PHP package ideacatlab/laravel-cookie-consent-enhanced without Composer

On this page you can find all versions of the php package ideacatlab/laravel-cookie-consent-enhanced. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-cookie-consent-enhanced

Elevate Your Laravel App's GDPR Compliance with Enhanced Cookie Consent

Ensuring compliance with EU laws on cookie usage is crucial for websites targeting or owned by EU citizens. Dive into the capabilities of this Laravel package, a robust extension originating from Spatie's Laravel Cookie Consent. Developed by IdeaCat, a web development agency in Bucharest, Romania, this package not only simplifies the implementation of a cookie consent dialog but also extends its functionalities. Beyond the essentials, it introduces advanced features like predefined database tables, administrative tools for user data management, and seamless integration of GDPR compliance requirements.

Explore further details about the EU legislation on cookies here.

Installation and Configuration

1. Install the Package

You can effortlessly install the package via Composer. Open your terminal and run:

The package will automatically register itself in your Laravel application.

2. Publish Vendor Files

Run the publish command to publish the views, languages, database migration, config and assets.

3. Migrate the Database

Execute the migration command to create the required database tables:

Configuration Details

Upon publishing the configuration file, you'll find a file named cookie-consent-enhanced.php in the config directory. Here's an overview of the configuration options:

Note on Cookie Domain

Ensure you set the cookie domain by using the 'domain' key in the config/session.php file. Add the corresponding value in your .env file for SESSION_DOMAIN. If your URL includes a port, such as 'localhost:3000', it is crucial to set this value for the package to function correctly.

Usage and Customization

Displaying the Cookie Consent Dialog Using Blade Template

To effortlessly display the cookie consent dialog in your template, include the following line in your Blade file:

This will render a dialog similar to the one depicted below. Note that the default styling, powered by TailwindCSS v2, creates a floating banner at the bottom of the page.

Displaying the Cookie Consent Dialog Using the Middleware

Instead of manually including cookie-consent-enhanced::index in your view, consider adding the middleware to your kernel:

This will automatically add cookie-consent-enhanced::index to your response just before the closing body tag.

Cookie Consent Dialog

Upon clicking "Allow cookies," a cookie_consent cookie will be set, and the dialog will be removed from the DOM. Laravel, recognizing the set laravel_cookie_consent cookie on subsequent requests, will refrain from displaying the dialog again.

Customizing Dialog Texts

The files is published to resources/lang/vendor/cookie-consent-enhanced/en/texts.php. You can then customize the text as follows:

For translations, copy the file to, for instance, resources/lang/vendor/cookie-consent-enhanced/fr/texts.php and provide the French translations.

Customizing Dialog Contents

The files is published to the index and dialogContents view files to resources/views/vendor/cookie-consent-enhanced. Typically, you only need to modify the dialogContents view. Adjusting the JavaScript code is possible in the index view file.

Testing

Execute the following command to run tests:

Security

If you discover any security-related issues, please contact [email protected] instead of using the issue tracker.

License

This project is licensed under the MIT License. See License File for more information.


All versions of laravel-cookie-consent-enhanced with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.23.1
illuminate/view Version ^10.23.1
illuminate/cookie Version ^10.23.1
spatie/laravel-package-tools Version ^1.16.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ideacatlab/laravel-cookie-consent-enhanced contains the following files

Loading the files please wait ....