dystcz/laravel-cookie-consent-history
Composer 安装命令:
composer require dystcz/laravel-cookie-consent-history
包简介
This package allows you to simply store cookie consent history for users, so you can access it later in the unfortunate event of inspection or something.
README 文档
README
This packages aims to make it easy to store anonymous cookie consents in a database in order to comply with rather strict EU cookie policy laws. Your application will get the power of keeping consent history, so you will have no problem with your burden of proof process when someone complains about your cookie consents.
Installation
You can install the package via composer:
composer require dystcz/laravel-cookie-consent-history
Publish config and migrations, run migrations
php artisan vendor:publish --provider="Dystcz\CookieConsentHistory\CookieConsentHistoryServiceProvider"
php artisan migrate
Register package routes in some of your route files, but if you want to use your own routes and controller, that is completely fine.
// routes/api.php use Dystcz\CookieConsentHistory\CookieConsentHistoryFacade; CookieConsentHistoryFacade::routes();
Configuration
return [ /** * The prefix for the table names. * You can use your own prefix here, eg. company_ if it were to conflict with existing table names. * We leave it empty, so the table name is cookie_consents by default. */ 'table_prefix' => '', /** * The prefix for routes. * There are only 2 routes, one for storing the consent data and one for retrieving. * * POST /cookie-consents (or your prefix) saves the consent * GET /cookie-consents/{id} gets the consent if exists */ 'route_prefix' => 'cookie-consents', /** * Model definition. * You can extend the base model to your needs. */ 'model' => Dystcz\CookieConsentHistory\Models\CookieConsent::class, ];
Usage
Storing consents
You can either register package routes, or you can introduce your own with your controller.
Below is an example store method which comes from Dystcz\CookieConsentHistory\Http\Controllers\CookieConsentsController.
/** * Store cookie consent data. * * @param StoreCookieConsentRequest $request * * @return \Illuminate\Http\JsonResponse */ public function store(StoreCookieConsentRequest $request) { // Create DTO out of validated request $data = new CookieConsentData(...$request->validated()); $consent = CookieConsentHistory::save($data); return new JsonResponse([ 'data' => $consent, ]); }
Complementary front end package
We aim to also provide a complementary javascript package, that will work nicely with this package making cookie law compliance as easy as possible.
Stay tuned.
Testing
Tests coming soon!
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email jakub@dy.st instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
dystcz/laravel-cookie-consent-history 适用场景与选型建议
dystcz/laravel-cookie-consent-history 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 20 次下载、GitHub Stars 达 3, 最近一次更新时间为 2022 年 01 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「dystcz」 「laravel-cookie-consent-history」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dystcz/laravel-cookie-consent-history 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dystcz/laravel-cookie-consent-history 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dystcz/laravel-cookie-consent-history 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Collection of ecommerce packages built on top of Lunar and Laravel JSON:API.
Multiselect field type for lunar ecommerce package
Datepicker field type for lunar ecommerce package
Manage workflows, business processes, multistep forms and more in Laravel.
Lunar PayPal integration for Laravel
This is my package lunar-api-paypal-adapter
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-26