invoice to mail

This commit is contained in:
Peter Papp
2021-04-27 07:31:16 +02:00
parent 7cf193abb7
commit 5be490c8d5
5 changed files with 48 additions and 16 deletions

View File

@@ -15,19 +15,30 @@ function is_route($name)
* @param $filepath
* @return string
*/
function get_storage_path($filepath)
function base64_from_storage_image($filepath)
{
if (is_null($filepath)) {
return null;
}
if (! Storage::exists($filepath)) {
if (!Storage::exists($filepath)) {
return null;
}
return 'data:' . Storage::mimeType($filepath) . ';base64,' . base64_encode(Storage::get($filepath));
}
/**
* Return invoice path to storage
*
* @param $invoice
* @return string
*/
function invoice_path($invoice)
{
return "files/{$invoice->user_id}/invoice-{$invoice->id}.pdf";
}
/**
* Get only tax for single invoice item
*