cherrypulp / laravel-gdpr
A laravel gdpr package
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-12-21 01:49:33 UTC
README
Laravel GDPR integration based on vue-gdpr
Installation
Install via composer
composer require cherrypulp/laravel-gdpr
Install the vue-gdpr :
npm install @cherrypulp/vue-gdpr --registry http://npm.cherrypulp.com
Register Service Provider
Note! This and next step are optional if you use laravel>=5.5 with package auto discovery feature.
Add service provider to config/app.php
in providers
section
Cherrypulp\LaravelGdpr\ServiceProvider::class,
Register Facade
Register package facade in config/app.php
in aliases
section
Cherrypulp\LaravelGdpr\Facades\LaravelGdpr::class,
Publish Configuration File
php artisan vendor:publish --provider="Cherrypulp\LaravelGdpr\ServiceProvider" --tag="config"
Usage
With your other scripts add :
@include('gdpr::script')
In your main VueJS bootstrap :
import VueGdprPlugin from '@cherrypulp/vue-gdpr';
Vue.use(VueGdprPlugin);
- Inside your VueJS app * :
Include the gdpr bar at a top:
@include('gdpr::bar')
Include the gdpr modal, in the bottom :
@include('gdpr::modal')
Exemple :
<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 !
Retrieve cookies informations
When accepted => you will have a cookie called gdpr_levels
$_COOKIE('gdpr_levels')
//or
Cookie::get('gdpr_levels')
//or
request()->cookie('gdpr_levels')
Configure the package
All the configuration is handled by the config and lang file and rely on the vue-gdpr package.
For more information on available :
https://gitlab.com/cherrypulp/components/vue-gdpr
Security
If you discover any security related issues, please email instead of using the issue tracker.