A Laravel package to manage cookie consent with ease. Provides customizable banners, GDPR/CCPA compliance, and seamless integration into Laravel Blade views. Ideal for websites needing user consent for cookies and tracking scripts.
- Create Project
composer create-project laravel/laravel example-app
- Install Package
composer require devrabiul/laravel-cookie-consent
- Configure Environment
cp .env.example .env
- Publish Config File
php artisan vendor:publish --provider="Devrabiul\CookieConsent\CookieConsentServiceProvider"
- Update HTML File
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Laravel Cookie Consent Demo</title>
{!! CookieConsent::styles() !!}
</head>
<body>
<!-- Your amazing content -->
{!! CookieConsent::scripts() !!}
</body>
</html>
- Migrate
php artisan breeze:install
php artisan migrate
npm install
npm run dev
- http://localhost:8000/ username :
admin
password :admin
php artisan serve