weble/laravel-cookiebar
Composer 安装命令:
composer require weble/laravel-cookiebar
包简介
Laravel Cookies Consent Management for the new EU Cookie LAW
README 文档
README
Laravel package for the new EU Cookie LAW. Provides a nice toolbar with a modal to select which consent
Installation
composer require weble/laravel-cookiebar
Publish Assets
Copy the assets required to run the laravel cookiebar into your project. This includes the javascript file, the language files and the views.
Publish All
php artisan vendor:publish --provider="Weble\Cookiebar\CookiebarServiceProvider"
Publish Only Views
php artisan vendor:publish --tag=cookiebar-views
Publish Only Assets
php artisan vendor:publish --tag=cookiebar-assets
Publish Only Translations
php artisan vendor:publish --tag=cookiebar-translations
Config - Optional
You can also optionally publish the configuration file.
php artisan vendor:publish --provider="Weble\Cookiebar\CookiebarServiceProvider" --tag="cookiebar-config"
Also, remember to follow the installation instructions for Spatie GoogleTagManager, which is included in this package and required to correctly use the cookeibar.
Usage
Once you've correctly Setup Spatie GoogleTagManager, be sure to set the option in the cookiebar configuration file to fit your needs.
Most of all, remember to enable the cookiebar and set the consents you need.
Include cookiebar::index in your layout according to your needs, usually before closing the body tag;
Include cookiebar::default-consents before googletagmanager::head;
Reopening the consent modal.
You can reopen the consent modal by calling
window.gtmCookieBar.editConsents()
Usually this is done in a link / button in the footer of your website.
Customizations
By default the cookiebar is styled using Tailwind CSS.
Add this configuration to your tailwing.config.js file to set the colors
cookiebar: { banner: { 'primary': '', // bg - button 'secondary': '', // text - buttont }, modal: { 'drop': '', 'primary': '', // title 'secondary': '', // text checkbox: { 'primary': '', // checked - border color 'secondary': '', // unchecked color }, button: { save: { 'primary': '', // button bg color 'secondary': '', // button text color 'hover': '', // button hover color }, cancel: { 'secondary': '', // button text color } } },
Add this configuration to your tailwing.config.js file to set the checkbox icon
... backgroundImage: theme => ({ ... 'cookiebar-modal-checkbox-icon': 'url("data:image/svg+xml,%3csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 20 20\'%3e%3cpath fill=\'none\' stroke=\'%23fff\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'3\' d=\'M6 10l3 3l6-6\'/%3e%3c/svg%3e")' ... }), ...
You can publish the views, assets and translations, and then edit the files in resources/view/vendor/cookiebar/ to better suit your needs.
weble/laravel-cookiebar 适用场景与选型建议
weble/laravel-cookiebar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.85k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 02 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cookie」 「eu」 「law」 「comply」 「cookiebar」 「cookie-consent」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 weble/laravel-cookiebar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 weble/laravel-cookiebar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 weble/laravel-cookiebar 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Make your Laravel app comply with the crazy EU cookie law
Add a configurable cookie consent banner to the website.
This extension allows you enable an EU compliant consent cookie notification banner.
Make your Laravel app comply with the crazy EU cookie law
Make your Laravel app comply with the crazy EU cookie law
Popup component for Nette Framework
统计信息
- 总下载量: 1.85k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-10