cookie('password') == '菇兔君' || ($_COOKIE['password'] ?? null) == '菇兔君') { return \Storage::disk('secret_folder')->get(md5('costco') . '.html'); } else { return ''; } } public function serviceWorker() { $content = view('service-worker.file', [ 'filesToCaches' => [ '/storage/costco/register-serviceworker.js', '/storage/costco/costco-icons.woff', '/storage/costco/logo.png', '/storage/costco/avatar.jpg', '/storage/costco/bar.png', '/storage/costco/menu.jpg', '/storage/costco/480.png', '/storage/costco/JsBarcode.all.min.js', '/costco/', ] ]); $response = \Response::make($content); $response->header('Content-Type', 'application/javascript; charset=utf-8'); return $response; } }