setcookie in laravel 8
Cookie::queue(Cookie::make('name', 'value', $minutes));
Cookie::queue('name', 'value', $minutes);
setcookie in laravel 8
Cookie::queue(Cookie::make('name', 'value', $minutes));
Cookie::queue('name', 'value', $minutes);
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">×</span>
</button>
</div>
</div>
Sources
- https://github.com/spatie/laravel-cookie-consent
- https://stackoverflow.com/questions/60719259/unable-to-locate-publishable-resources
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us