How to add logo to stripe invoice pdf. I'm using laravel framework. Is there any way I can modify the blade file under vendor section? and commit the same.
Asked
Active
Viewed 1,710 times
2 Answers
7
Run php artisan vendor:publish
.
This will create vendor/cashier/receipt.blade.php
file in your views
folder, which you can modify as per your requirement & commit.

milo526
- 5,012
- 5
- 41
- 60

snehawaghela
- 96
- 3
-
This is fine but no matter what I do, the image just won't display. I am using format:
The logo image exists but I'm getting error that the image can't be found. Any ideas? – pdolinaj Sep 07 '21 at 08:33
-
You probably gave up / solved the issue long since @pdolinaj but for your question / anyone else searching, use base path when it's PDF - `{{ base_path().DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'/img/logos/logo.png' }}` – Grant May 22 '22 at 15:54
0
- Extend Cashier's Invoice -
Laravel\Cashier\Invoice
. - Add
$options->setIsRemoteEnabled(true);
to pdf method:
public function pdf(array $data)
{
if (! defined('DOMPDF_ENABLE_AUTOLOAD')) {
define('DOMPDF_ENABLE_AUTOLOAD', false);
}
$options = new Options;
$options->setChroot(base_path());
$options->setIsRemoteEnabled(true);
$dompdf = new Dompdf($options);
$dompdf->setPaper(config('cashier.paper', 'letter'));
$dompdf->loadHtml($this->view($data)->render());
$dompdf->render();
return $dompdf->output();
}

Dejan Prole
- 259
- 3
- 16