Download the PHP package taki47/laravel-cookie-consent without Composer
On this page you can find all versions of the php package taki47/laravel-cookie-consent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download taki47/laravel-cookie-consent
More information about taki47/laravel-cookie-consent
Files in taki47/laravel-cookie-consent
Package laravel-cookie-consent
Short Description Advanced Laravel GDPR cookie consent manager with categorized consent and automatic script blocking.
License MIT
Informations about the package laravel-cookie-consent
Laravel Privacy Panel
A modern, lightweight, and fully self-contained GDPR-ready privacy panel for Laravel.
Automatically detects, blocks, and manages analytics and marketing scripts with zero external dependencies.
Features
- Automatic detection and blocking of tracking scripts
- Dynamic cookie categories (necessary / statistics / marketing)
- AJAX-based consent saving (no page reload)
- Google Consent Mode v2 support
- Cookie cleanup when consent is revoked
- Re-openable floating icon
- Artisan command for cache cleanup
- Simple publish and setup process
- Compatible with Laravel 10, 11, and 12+
Installation
Install via Composer:
Publish assets:
This will publish: public/vendor/privacy-panel/
Before going live, scan your site so the banner can display cookie details (name, purpose, expiry) correctly:
IMPORTANT: Before running the scan, make sure that APP_URL is set in your .env file to the website URL that the crawler needs to scan! Alternatively, you can pass the URL as an argument.
The cookie:scan command supports the following optional parameters:
{url? : (Optional) The website URL to scan, defaults to APP_URL}{--depth=2 : Crawl depth (default 2)}{--max-pages=100 : Maximum pages to crawl}{--fetch-external-js : Also fetch external JS files (may slow down)}{--delay=250 : Delay between requests in ms (politeness)}
Include the consent banner in your base layout (for example layouts/app.blade.php):
Load the cookie script before any analytics scripts:
Artisan command
Clear cached cookie metadata and scan results:
Use --force to skip confirmation:
How it works
Automatic script blocking Known analytics and marketing scripts are detected and converted to before execution.
User consent handling User preferences are saved via AJAX to the cookie-consent.store route.
Re-enabling approved scripts Scripts belonging to approved categories (e.g., statistics, marketing) are dynamically reactivated without page reload.
Consent updates and cleanup When a user revokes consent, the package deletes related cookies and updates Google Consent Mode accordingly.
Contributing
Pull requests are welcome! Please follow PSR-12 coding standards and use English comments only.
License
Released under the MIT License.
© 2025 Lajos Takacs
Support
If you find this package useful, please give it a star on GitHub ⭐ Your support helps keep the project open and actively maintained.