I am trying to set the page title in Laravel to be the name of the file that is being viewed in the browser. I have looked through the documentation and questions on stack overflow and cannot seem to find the solution. The page title keeps defaulting to the primary key
public function download(SomeModel $document)
{
if(Storage::disk('s3')->exists($document->file_path)) {
return \Response::make(Storage::disk('s3')->get($document->file_path), 200, [
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'inline; filename="'. $document->custom_file_name .'"'
]);
}
return view('errors.404');
}
How can I make it to where the <title></title>
of the page is using the $document->custom_file_name
as opposed to being the id.