Skip to content

Commit d23134d

Browse files
committed
refactored the way that the front-end assets are used
1 parent 91b812e commit d23134d

File tree

5 files changed

+11
-16
lines changed

5 files changed

+11
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ All notable changes to `laravel-cookies-consent` will be documented in this file
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8-
## v3.0.6 - Assets files are no longer published in the public directory - 2025-01-31
8+
## v3.1.0 - Changes in assets files in the public - 2025-01-31
99

1010
In order to simplify the installation process and avoid potential conflicts with existing assets, the front-end assets
11-
are no longer published in the public directory. The assets are now included directly in the package and loaded from the
12-
vendor directory.
11+
are now included directly in the package and loaded from the `vendor/scify/laravel-cookies-consent/` directory.
1312

14-
This means that the `public/vendor/cookies_consent` directory now should contain only the `cookie.png` image file.
13+
This means that the `public/vendor/cookies_consent` directory should be deleted, and the assets should be published again:
1514

1615
In order to update to the new version, you need to remove the `public/vendor/cookies_consent` directory and run the
1716
asset publishing command:
@@ -25,7 +24,7 @@ And then:
2524
```bash
2625
php artisan vendor:publish \
2726
--provider="SciFY\LaravelCookiesConsent\LaravelCookiesConsentServiceProvider" \
28-
--tag="cookies-consent-assets"
27+
--tag="cookies-consent-public"
2928
```
3029

3130
## v3.0.2 - Major Release - JSON Cookie Storage & Configuration Changes - 2025-01-30

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "laravel-cookies-consent",
3-
"version": "3.0.6",
3+
"version": "3.1.0",
44
"description": "<p align=\"center\"> <img src=\"logo.jpg\" alt=\"logo\" width=\"400\"> </p>",
55
"main": "index.js",
66
"directories": {

resources/views/components/laravel-cookies-consent.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
@if(config('cookies_consent.display_floating_button'))
6363
<div id="scify-cookie-consent-floating-button" class="cookie-button" style="display: none;"
6464
onclick="toggleCookieBanner()">
65-
<img src="{{ asset('/vendor/cookies_consent/images/cookie.png') }}" alt="Cookie">
65+
<img src="{{ asset('vendor/scify/laravel-cookies-consent/cookie.png') }}" alt="Cookie">
6666
</div>
6767
@endif
6868
{{--<a href="javascript:void(0);" onclick="toggleCookieBanner()">Manage Cookies</a>--}}
69-
@vite('vendor/scify/laravel-cookies-consent/public/cookies-consent.js')
70-
@vite('vendor/scify/laravel-cookies-consent/public/cookies-consent.css')
69+
<link rel="stylesheet" href="{{ asset('vendor/scify/laravel-cookies-consent/cookies-consent.css') }}">
70+
<script src="{{ asset('vendor/scify/laravel-cookies-consent/cookies-consent.js') }}"></script>

src/LaravelCookiesConsentServiceProvider.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ class LaravelCookiesConsentServiceProvider extends ServiceProvider {
99
public function boot() {
1010
$this->loadViewsFrom(__DIR__ . '/../resources/views', 'cookies-consent');
1111

12-
$this->publishes([
13-
__DIR__ . '/../public/cookie.png' => public_path('vendor/cookies_consent/images/cookie.png'),
14-
], 'cookies-consent-assets');
15-
1612
$this->publishes([
1713
__DIR__ . '/../resources/views/components/' => resource_path('views/vendor/cookies_consent/components'),
1814
], 'cookies-consent-components');
1915

2016
$this->publishes([
21-
__DIR__ . '/../public' => public_path('vendor/cookie-consent'),
17+
__DIR__ . '/../public' => public_path('vendor/scify/laravel-cookies-consent'),
2218
], 'cookies-consent-public');
2319

2420
$this->publishes([

0 commit comments

Comments
 (0)