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

On this page you can find all versions of the php package fet/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

Introduction

The fet/laravel-cookie-consent package is a simple Laravel wrapper around the orestbida/cookieconsent package.

Installation

  1. composer require fet/laravel-cookie-consent
  2. php artisan vendor:publish --provider="Fet\CookieConsent\CookieConsentServiceProvider" --tag="config"

Configuration

The configuration consists of three keys: enable, routes and config. The config value is an array representation of the Configuration object and is passed to the CookieConsent package as JSON. Feel free to configure the package as you like.

POST Route

The Callback/Events are not directly configurable. Instead you can define a routes.post which corresponds to an existing route name which is then called via POST request when the events onFirstConsent or onChange are triggered.

If the routes.post is empty, no POST request is sent.

The data received by the controller looks like this:

Redirect Route

If you want to perform a page redirect after the user has made the cookie consent choice, you can provide a route name to routes.redirect.

If the routes.redirect is empty, no redirect is made.

Exclude

To exclude the cookie consent from appearing on certain URL paths, add those paths to the paths.exclude configuration array.

You can use valid regex patterns. For example, to exclude all /admin/* paths, add admin(\/.*)? to the exclude array.

Events

Sometimes you may need to change the configuration, after the application is booted. You can do so by listening to the \Fet\CookieConsent\Events\ConfigLoaded event.

Tests

Run the tests with:


All versions of laravel-cookie-consent with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
illuminate/support Version ^10.0|^11.0
illuminate/events Version ^10.0|^11.0
fet/laravel-php-to-js Version ^0.2
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 fet/laravel-cookie-consent contains the following files

Loading the files please wait ....