where('is_active', true) ->first(); if (! $website) { return response('', 404) ->header('Content-Type', 'application/javascript'); } $collectUrl = route('collect.store'); $js = view('tracking.tracker', [ 'trackingId' => $trackingId, 'collectUrl' => $collectUrl, ])->render(); return response($js) ->header('Content-Type', 'application/javascript') ->header('Cache-Control', 'public, max-age=3600'); } }