Laravel cookie in serviceprovider not comparable
问题 I try to pass a variable based on a cookie value in my compose function to all my view to build my menu, with the use of serviceproviders recommmended here: File: Providers/ViewComposerServiceProvicer.php public function boot(Request $request) { $this->composeTopBar($request);} public function composeTopBar(Request $request) { $cookieValue = $request->cookie('brand'); // if value not set use default value. if($cookieValue == null) { $cookieValue = 1; } $brands = \App\Brand::orderBy('priority'