File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 6969
7070{{-- STYLES & SCRIPT : feel free to remove them and add your own --}}
7171
72- <script data-cookie-consent >
72+ <script id = " cookies-script " data-cookie-consent data-config = " {{ $scriptConfig } } " >
7373 {!! file_get_contents (LCC_ROOT . ' /dist/script.js' ) ! !}
7474 </script >
7575<style data-cookie-consent >
7676 {!! file_get_contents (LCC_ROOT . ' /dist/style.css' ) ! !}
77- </style >
77+ </style >
Original file line number Diff line number Diff line change @@ -224,9 +224,20 @@ public function getNoticeMarkup(): string
224224 return view ('cookie-consent::cookies ' , [
225225 'cookies ' => $ this ->registrar ,
226226 'policy ' => $ policy ,
227+ 'scriptConfig ' => $ this ->generateConfig (),
227228 ])->render ();
228229 }
229230
231+ protected function generateConfig (): string
232+ {
233+ return json_encode ([
234+ 'accept.all ' => route ('cookieconsent.accept.all ' ),
235+ 'accept.essentials ' => route ('cookieconsent.accept.essentials ' ),
236+ 'accept.configuration ' => route ('cookieconsent.accept.configuration ' ),
237+ 'reset ' => route ('cookieconsent.reset ' ),
238+ ]);
239+ }
240+
230241 /**
231242 * Output a single cookie consent action button.
232243 */
You can’t perform that action at this time.
0 commit comments