-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invoice download can change file name #715
Labels
Comments
@4UForever use Illuminate\Http\Request;
Route::get('user/invoice/{invoice}', function (Request $request, $invoiceId) {
$response = $request->user()->downloadInvoice($invoiceId, [
'vendor' => 'Your Company',
'product' => 'Your Product',
]);
$filename = 'custom.pdf';
$response->headers->set('Content-Disposition', 'attachment; filename="'.$filename.'"');
return $response;
}); |
@Sti3bas many thanks for your advise and your sample code is so helpful for me. :) |
I've sent in a PR for this here: #723 |
jfrabaute
added a commit
to jfrabaute/cashier
that referenced
this issue
Oct 24, 2019
This can be done by the caller: laravel#715 (comment)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you please allow to change file name (.pdf) in download invoice or can I custom the name of the download file, Now it's like fixed file name .
https://github.com/laravel/cashier/blob/9.0/src/Invoice.php#L269
many thanks.
The text was updated successfully, but these errors were encountered: