Download the PHP package pascalkrieger/laravel-cookie-consent without Composer

On this page you can find all versions of the php package pascalkrieger/laravel-cookie-consent. 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

Laravel Cookie Consent

This package currently work in progress.

The package provides the views and controllers necessary to display a fixed message at the bottom of the window, prompting the user to accept the cookies or configure them.

If the user chooses to configure the cookies a modal will be displayed listing all types of cookies the website uses, allowing to disable or enable certain types. Once his preferences are saved a button is displayed enabling the user to configure his preferences.

The views are styled with tailwindcss and alpinejs leverages the rest, so these are prerequisite in your Laravel project.

Once the preferences are saved, you can check in your views if a certain type of cookies is allowed like this:

Where Functional corresponds to one of the type values in the cookies array of your config file.

Installation

This package is intended for use in existing Laravel projects using Tailwindcss and AlpineJS.

You can install the package via composer:

Tailwindcss and AlpineJS should be installed, if not install them following the instructions in their documentation.

For Tailwindcss visit: https://tailwindcss.com/docs/guides/laravel

For AlpineJS visit: https://alpinejs.dev/essentials/installation

Publish the views running:

Then run:

Usage

Include the blade component at the bottom of your page or layout:

You should publish and edit the config file, run this command:

The code is pretty basic and self explanatory. As stated before this is work in progress, in use right now in some of my other projects. You´re welcome to use it as you wish.

Localization

The package currently ships with translations for English and Spanish. you can easily add more languages, first publish the packages lang folder with:

Add a folder to lang/vendor/laravel-cookie-consent with your language code, for example lang/vendor/laravel-cookie-consent/de, and place a text.php file with the following contents within it:


All versions of laravel-cookie-consent with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^8.0|^9.0|^10.0
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 pascalkrieger/laravel-cookie-consent contains the following files

Loading the files please wait ....