samsmithcodes/cookie-popup
最新稳定版本:1.0.1
Composer 安装命令:
composer require samsmithcodes/cookie-popup
包简介
This is a Laravel package to add a cookie popup to your project.
关键字:
README 文档
README
This package adds a cookie popup to your application.
Installing
To install this package, run the following composer command:
composer require samsmithcodes/cookie-popup
Publish Files
You can publish the config and view files to your application for customization, just run the following commands:
php artisan vendor:publish --tag=cookie-popup-config
php artisan vendor:publish --tag=cookie-popup-view
php artisan vendor:publish --tag=cookie-popup-translations
php artisan vendor:publish --tag=cookie-popup-tailwind-safelist
The Component
You need to add this component to your <body> block, it contains the code required to display the popup.
<x-cookie-popup />
Tailwind Safelist
The component is styled with Tailwind classes, these classes are listed in a package-safelist.css file, you can include this in your CSS file to ensure the classes are compiled by Tailwind.
If you have published the CSS file, add this:
@import "vendor/cookie-popup/package-safelist.css";
If you have not published the CSS file, you can import it from the package like so:
@import "../../vendor/samsmithcodes/cookie-popup/resources/css/package-safelist.css";
Development
To develop the package, you should first setup a clean Laravel project and then create a new directory called packages/samsmithcodes.
Then, checkout this repository into that directory.
git clone git@github.com:samsmithcodes/cookie-popup.git
Install the package dependencies with composer install.
To install the package to test, go back to the root of the Laravel project you setup and add the following to the composer.json file.
"repositories": [
{
"type": "path",
"url": "./packages/samsmithcodes/cookie-popup",
"options": {
"symlink": true
}
}
],
Then, run the following composer command to install the package.
composer require samsmithcodes/cookie-popup:@dev
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-05