get('bannerSetting')) { $content = $bannerSettings; } else { $banners = Banner::select('type', 'message as text', 'dismissable') ->get(); $response = $banners->toJson(); $redis->put('bannerSetting', $response, now()->addMinutes(5)); $content = $response; } return response($content) ->header('Content-Type', 'application/json'); } }