承接 bkc-media/twill-cookie-consent 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bkc-media/twill-cookie-consent

最新稳定版本:v0.9.3-beta

Composer 安装命令:

composer require bkc-media/twill-cookie-consent

包简介

A cookie twill package

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

This package provides a simple way to add cookie consent to your Twill 3x project by adding cookie scripts based on user preferences using the CMS.

Requirements

  • PHP: ^8.0
  • area17/twill: ^3.0
  • Laravel: ^8|^9

Installation

You can install the package via composer:

composer require bkc-media/twill-cookie-consent 

Publish the assets to include necessary javascript and css files:

php artisan vendor:publish --provider="BKCmedia\TwillCookieConsent\TwillCookieConsentServiceProvider" --tag="twill-cookie-consent-assets" --force 

Optionally publish the config file:

php artisan vendor:publish --provider="BKCmedia\TwillCookieConsent\TwillCookieConsentServiceProvider" --tag="twill-cookie-consent-config"

Optionally publish the lang files:

php artisan vendor:publish --provider="BKCmedia\TwillCookieConsent\TwillCookieConsentServiceProvider" --tag="twill-cookie-consent-translations"

The contents of the published config file will look like this:

return [
    /*
     * The cookie name in which we store which cookie id's the user has consented to.
     */
    'cookie_name' => 'tcc_cookie_consent',

    /*
     * Set the cookie duration in minutes.  Default is 60 * 24 * 365.
     */
    'cookie_lifetime' => 60 * 24 * 365,

    /*
     * Set primary color for cookie consent accept all buttons, default is green.
     */
    'primary_color' => '#65A30D',
];

Run migration to add the twill cookie singleton:

php artisan migrate 

Usage

After migration you can add the cookie consent content by going to the cookie module in the CMS. Add the cookie consent banner description and intro settings content. Use the block editor to add cookie categories and the repeater inside the block to add cookie information and necessary scripts per location: head, body or footer.

Add the cookie consent banner to your app.blade.php file or any other layout file:

@include('twill-cookie-consent::components.cookie-consent')

Based on provider scripts add one or all of the following in the right location in your app.blade.php file or any other layout file:

@include('twill-cookie-consent::components.head-scripts')

@include('twill-cookie-consent::components.body-scripts')

@include('twill-cookie-consent::components.footer-scripts')

Based on the user preferences the scripts will be added to the page in the right location.

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 1
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-16