PHPackages                             taki47/laravel-cookie-consent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. taki47/laravel-cookie-consent

Abandoned → [taki47/laravel-privacy-panel](/?search=taki47%2Flaravel-privacy-panel)Library[Utility &amp; Helpers](/categories/utility)

taki47/laravel-cookie-consent
=============================

Advanced Laravel GDPR cookie consent manager with categorized consent and automatic script blocking.

v1.0.7(1w ago)173↓92.9%MITPHPPHP ^8.2

Since Oct 31Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/taki47/laravel-privacy-panel)[ Packagist](https://packagist.org/packages/taki47/laravel-cookie-consent)[ RSS](/packages/taki47-laravel-cookie-consent/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

Laravel Privacy Panel
=====================

[](#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
--------

[](#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
------------

[](#installation)

Install via Composer:

```
composer require taki47/laravel-privacy-panel

```

Publish assets:

```
php artisan vendor:publish --provider="Taki47\PrivacyPanel\PrivacyPanelServiceProvider" --tag=public

```

Laravel's standard Composer update hook also republishes these files through the `laravel-assets` tag, keeping the browser asset in sync with package updates.

This will publish: public/vendor/privacy-panel/

Before going live, scan your site so the banner can display cookie details (name, purpose, expiry) correctly:

```
php artisan cookie:scan

```

**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):

```
@include('privacy-panel::banner')

```

Load the cookie script once, before any analytics scripts. The banner supplies the configuration consumed by this script, so do not include the script a second time after the banner:

```

```

Artisan command
---------------

[](#artisan-command)

Clear cached cookie metadata and scan results:

```
php artisan cookie:clear-cache

```

Use --force to skip confirmation:

```
php artisan cookie:clear-cache --force

```

How it works
------------

[](#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
------------

[](#contributing)

Pull requests are welcome! Please follow PSR-12 coding standards and use English comments only.

License
-------

[](#license)

Released under the MIT License. © 2025 Lajos Takacs &lt;takiwebneked.hu&gt;

Support
-------

[](#support)

If you find this package useful, please give it a star on GitHub ⭐ Your support helps keep the project open and actively maintained.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance88

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~23 days

Total

7

Last Release

11d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44288774?v=4)[Lajos Takacs](/maintainers/taki47)[@taki47](https://github.com/taki47)

---

Top Contributors

[![taki47](https://avatars.githubusercontent.com/u/44288774?v=4)](https://github.com/taki47 "taki47 (2 commits)")

### Embed Badge

![Health badge](/badges/taki47-laravel-cookie-consent/health.svg)

```
[![Health](https://phpackages.com/badges/taki47-laravel-cookie-consent/health.svg)](https://phpackages.com/packages/taki47-laravel-cookie-consent)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[illuminate/redis

The Illuminate Redis package.

8314.6M375](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

244.6M136](/packages/illuminate-cookie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
