cherrypulp / laravel-gdpr
一个 Laravel GDPR 包
1.0.1
2021-03-04 13:35 UTC
Requires
- php: >=7.1.6
- spatie/laravel-cookie-consent: 2.*
Suggests
- @cherrypulp/vue-gdpr: Don't forget to add the cherrypulp/vue-gdpr component !
This package is not auto-updated.
Last update: 2024-09-14 00:44:13 UTC
README
基于 vue-gdpr 的 Laravel GDPR 集成
安装
通过 composer 安装
composer require cherrypulp/laravel-gdpr
安装 vue-gdpr
npm install @cherrypulp/vue-gdpr --registry http://npm.cherrypulp.com
注册服务提供者
注意!如果您使用的是 laravel>=5.5 并且启用了包自动发现功能,以下步骤是可选的。
将服务提供者添加到 config/app.php
文件的 providers
部分
Cherrypulp\LaravelGdpr\ServiceProvider::class,
注册外观
在 config/app.php
文件的 aliases
部分注册包外观
Cherrypulp\LaravelGdpr\Facades\LaravelGdpr::class,
发布配置文件
php artisan vendor:publish --provider="Cherrypulp\LaravelGdpr\ServiceProvider" --tag="config"
使用方法
在您的其他脚本中添加
@include('gdpr::script')
在您的主 VueJS 引导中 :
import VueGdprPlugin from '@cherrypulp/vue-gdpr';
Vue.use(VueGdprPlugin);
- 在您的 VueJS 应用程序内部 *
在顶部包含 GDPR 栏
@include('gdpr::bar')
在底部包含 GDPR 模态框
@include('gdpr::modal')
示例
<div class="app" role="main" v-cloak>
@include('gdpr::bar')
<header class="app-header">
@yield('header')
</header>
<main class="app-body">
@yield('content')
</main>
<footer class="app-footer" role="contentinfo">
@section('footer')
@yield('footer')
{{-- @include('parts.footer-simple') --}}
@show
</footer>
@stack('modals')
@include('gdpr::modal')
</div>
# Don't put it outside your Vue App !
检索 cookies 信息
当被接受 => 您将有一个名为 gdpr_levels 的 cookie
$_COOKIE('gdpr_levels')
//or
Cookie::get('gdpr_levels')
//or
request()->cookie('gdpr_levels')
配置包
所有配置都由配置和语言文件处理,并依赖于 vue-gdpr 包。
有关可用配置的更多信息
https://gitlab.com/cherrypulp/components/vue-gdpr
安全
如果您发现任何与安全相关的问题,请通过电子邮件联系,而不是使用问题跟踪器。