mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-19 00:22:15 +00:00
get invoice from url
This commit is contained in:
@@ -16,6 +16,7 @@ use Illuminate\Contracts\Routing\ResponseFactory;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Illuminate\Support\Str;
|
||||
use Storage;
|
||||
|
||||
class InvoiceController extends Controller
|
||||
{
|
||||
@@ -39,6 +40,19 @@ class InvoiceController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Invoice $invoice
|
||||
* @return \Symfony\Component\HttpFoundation\StreamedResponse
|
||||
*/
|
||||
public function get_invoice(Invoice $invoice)
|
||||
{
|
||||
if (! Storage::exists(invoice_path($invoice))) {
|
||||
abort(404, 'Not Found');
|
||||
}
|
||||
|
||||
return Storage::download(invoice_path($invoice), "invoice-{$invoice->id}.pdf");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user