@Contoweb Why are you trying to generate a shell file with Blade, and why are you trying to download shell files?
Blade is a templating language. It has no role doing anything functional such as generating scripts.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi
I try to generate a shell script with a blade template. Now, the generateted file always has \r\n line break instead of \n (download it directly with curl on the system)
My response method (removed the variables...):
private function downloadShell($id, $name) {
$file = Storage::disk('local')->get('shellscripts/shell.sh');
return (new Response($file))
->header('Content-Type', 'text/plain');
}
Should I work with str_replace or is there a smarter way to convert it for unix? Thanks for your help!
Regards,
Please or to participate in this conversation.