Download the PHP package mmoollllee/laravel-consent-control without Composer

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

Laravel Consent Control

GDPR cookie-consent banner and content blocking for Laravel — server-rendered Blade on top of the framework-agnostic consent-control JavaScript runtime.

This is the Laravel layer of a three-package stack:

Package Role
consent-control (npm) Framework-agnostic runtime + CSS (plain HTML, WordPress, any framework).
laravel-consent-control (this package) Blade components, config, drivers, translations, server helpers.
filament-consent-control Optional Filament admin UI (settings form + RichEditor iframe plugin).

A single config file is all you need — no database, no admin panel required.

Features

Requirements

Installation

Publish the config and the runtime assets:

Optionally publish the translations to customise them:

Frontend usage

Render the banner and load the runtime (once per page, e.g. before </body>):

<x-consent-control-scripts /> ships a standalone stylesheet by default. If you bundle the CSS yourself (see Assets) disable it with :standalone-css="false".

Block an iframe until consent

Block custom content until consent

Conditional content

Re-open the banner

Configuration

Everything lives in config/consent-control.php. Labels and descriptions may be plain strings or translation keys — both are resolved through __(), so the shipped defaults are multilingual out of the box.

Declare the scripts/JS to run when a category is granted:

Consent versioning

Bump version whenever your categories or privacy policy change — visitors whose stored version differs are re-prompted (their consent is reset):

Block your own scripts

Render inert scripts that activate only on consent:

Eloquent driver (opt-in)

Store settings as JSON on one of your own models instead of the config file:

Editing that JSON with a ready-made Filament form is what filament-consent-control adds.

Frontend assets (choose one)

Render the banner and the boot component once per page (e.g. before </body>):

The banner is designed to inherit your site's design — pick the path that fits your setup:

A) Bundle it yourself — recommended. The runtime JS and the overlay CSS become part of your Vite build (no extra requests, full control), and Tailwind styles the banner Blade: it adopts your design tokens (gray scale, the toggle uses your --color-primary) and your button components (.btn, .btn-primary, .btn-secondary) automatically.

With :assets="false" the component emits only the inline ConsentControl.init(...) boot config. (Alternatively npm i consent-control and import from node_modules — same runtime.)

B) Published assets — no build step. Publish the runtime and let the component load it:

Tailwind projects still add the @source line above and pass :standalone-css="false" (the Blade styles the banner). Projects without a utility/button system keep the default: a small neutral stylesheet styles banner + overlay buttons and still adopts your brand where it can — the accent reads --color-primary / --bs-primary, and every --cc-* variable can be overridden:

C) Full control. Publish the views and make them yours — the runtime only needs its selector contract (#consent-control-banner, input[value=<category>], #consent-control--submit(-all), .consent-control--open/--close/--reset, .collapsed-only/.uncollapsed-only and the hide/is-collapsed state classes):

Reopening the banner

Visitors must be able to change their choice later (GDPR). Place a button with the consent-control--open class anywhere — typically on the privacy policy page; the runtime binds every such element on init and reopens the banner with the settings expanded:

Opening moves the keyboard focus into the banner, saving moves it back to the button.

Withdrawing consent and the reset button

Scripts a category has loaded keep running after a visitor withdraws it, so the runtime reloads the page then, and after the reset button ("delete all cookies"). The reset button deletes every cookie and localStorage entry the page can reach — keep what your app needs:

Components & directives

Component / directive Description
<x-consent-control-banner /> / @consentBanner Consent banner
<x-consent-control-message consent="…" src="…" /> Iframe/content with consent overlay
<x-consent-control-gate consent="…"> Slot shown only on consent
<x-consent-control-script consent="…" src="…" /> Consent-gated <script> tag
<x-consent-control-scripts /> / @consentScripts Runtime + boot config
@consent('analytics') … @endconsent Server-side conditional

JavaScript events

window receives a consent-updated event whenever consent changes:

License

MIT. See LICENSE.md.


All versions of laravel-consent-control with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.28|^12.0|^13.0
illuminate/support Version ^11.28|^12.0|^13.0
spatie/laravel-package-tools Version ^1.16
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 mmoollllee/laravel-consent-control contains the following files

Loading the files please wait ...