Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Laravel Adding Cookie Consent

1 - Add this package 

https://github.com/spatie/laravel-cookie-consent

2 - publish the package to get the custom configuration

php artisan vendor:publish

3 - Add this in the home page in the top

@include('cookieConsent::index')

4 - Add the below style in the file “resources/views/vendor/cookieConsent/dialogContents.blade.php”

<div class="js-cookie-consent cookie-consent">
    <div class="alert alert-warning alert-dismissible fade show text-center" role="alert" style="margin-bottom: 0rem !important;">
        <span class="cookie-consent__message">
            {!! trans('cookieConsent::texts.message') !!}
        </span>

        <button class="js-cookie-consent-agree cookie-consent__agree btn btn-sm btn-primary">
            {{ trans('cookieConsent::texts.agree') }}
        </button>

        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
</div>
              
 Sources
- https://github.com/spatie/laravel-cookie-consent              
-  https://stackoverflow.com/questions/60719259/unable-to-locate-publishable-resources
Comment

PREVIOUS NEXT
Code Example
Php :: Laravel migrations custom foreign key 
Php :: print in file php 
Php :: php foreach loop first element 
Php :: laravel collection times 
Php :: php apply function to array elements 
Php :: laravel vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php:36 
Php :: wordpress widget current year 
Php :: python to php 
Php :: message get with return action laravel 
Php :: laravel Auth::logoutOtherDevices 
Php :: php webpage to string 
Php :: laravel validation numeric vs integer 
Php :: laravel validation types 
Php :: create database in php 
Php :: convert array to IlluminateHttpRequest 
Php :: php foreach loop 
Php :: php isset form submit 
Php :: laravel simplexmlelement not found 
Php :: php search multidimensional array for multiple values 
Php :: display money format php 
Php :: php hour between 
Php :: post data to another page contact form 7 
Php :: remove blank data in multidimention array in laravel 
Php :: sort an array in php manually 
Php :: Doctor Strange 
Php :: php null coalesce 
Php :: destruct php 
Php :: download file laravel s3 
Php :: php get html tags from string 
Php :: create a module laravel 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =