| Conditions | 1 |
| Paths | 1 |
| Total Lines | 32 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function boot() |
||
| 13 | { |
||
| 14 | $this->publishes([ |
||
| 15 | __DIR__.'/../config/cookie-consent.php' => config_path('cookie-consent.php'), |
||
| 16 | ], 'config'); |
||
| 17 | |||
| 18 | $this->publishes([ |
||
| 19 | __DIR__.'/../resources/views' => base_path('resources/views/vendor/cookieConsent'), |
||
| 20 | ], 'views'); |
||
| 21 | |||
| 22 | $this->publishes([ |
||
| 23 | __DIR__.'/../resources/lang' => base_path('resources/lang/vendor/cookieConsent'), |
||
| 24 | ], 'lang'); |
||
| 25 | |||
| 26 | $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'cookieConsent'); |
||
| 27 | |||
| 28 | $this->mergeConfigFrom(__DIR__.'/../config/cookie-consent.php', 'cookie-consent'); |
||
| 29 | |||
| 30 | $this->loadViewsFrom(__DIR__.'/../resources/views', 'cookieConsent'); |
||
| 31 | |||
| 32 | $this->app->resolving(EncryptCookies::class, function (EncryptCookies $encryptCookies) { |
||
| 33 | $encryptCookies->disableFor(config('cookie-consent.cookie_name')); |
||
| 34 | }); |
||
| 35 | |||
| 36 | $this->app['view']->composer('cookieConsent::index', function (View $view) { |
||
| 37 | $cookieConsentConfig = config('cookie-consent'); |
||
| 38 | |||
| 39 | $alreadyConsentedWithCookies = Cookie::has($cookieConsentConfig['cookie_name']); |
||
| 40 | |||
| 41 | $view->with(compact('alreadyConsentedWithCookies', 'cookieConsentConfig')); |
||
| 42 | }); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |