latest updates

This commit is contained in:
ghassan committed 2026-01-22 17:50:19 +03:00
1 parent 36aea9a266
commit b0c49bc6e4
12 files changed
+312 -318

No files matched your search

+9 -2
View File
@@ -53,9 +53,9 @@ class InvoiceController extends Controller
* Display the receipt for the specified invoice.
*
* @param int $id
* @return \Illuminate\View\View
* @return \Illuminate\View\View|\Illuminate\Http\Response
*/
public function receipt($id)
public function receipt(Request $request, $id)
{
$user = Auth::user();
$invoice = Invoice::where('id', $id)
@@ -63,6 +63,13 @@ class InvoiceController extends Controller
->with(['student', 'tenant'])
->firstOrFail();
if ($request->has('download')) {
$html = view('invoices.receipt', compact('invoice'))->render();
return response($html)
->header('Content-Type', 'text/html')
->header('Content-Disposition', 'attachment; filename="receipt_' . $invoice->id . '.html"');
}
return view('invoices.receipt', compact('invoice'));
}