Answer the question
In order to leave comments, you need to log in
How to change the name of the given file on the fly in Laravel?
I store the filename and realname fields from the database, the second of them is generated automatically, when downloading it is issued
public function download(Document $document){
//return $document;
$pathToFile = storage_path()."/app/".$document->realname;
return response()->download($pathToFile);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question