added the listing of the clubs but didnt succseed

This commit is contained in:
ghassan committed 2026-01-22 04:44:25 +03:00
1 parent 0efe1f69e5
commit 59ad30575c
12 files changed
+737 -124

No files matched your search

+24 -3
View File
@@ -34,7 +34,7 @@ class InvoiceController extends Controller
* @param int $id
* @return \Illuminate\View\View
*/
public function show($id)
public function show(Request $request, $id)
{
$user = Auth::user();
$invoice = Invoice::where('id', $id)
@@ -42,9 +42,30 @@ class InvoiceController extends Controller
->with(['student', 'tenant'])
->firstOrFail();
if ($request->ajax()) {
return response()->json(['html' => view('invoices._show_modal', compact('invoice'))->render()]);
}
return view('invoices.show', compact('invoice'));
}
/**
* Display the receipt for the specified invoice.
*
* @param int $id
* @return \Illuminate\View\View
*/
public function receipt($id)
{
$user = Auth::user();
$invoice = Invoice::where('id', $id)
->where('payer_user_id', $user->id)
->with(['student', 'tenant'])
->firstOrFail();
return view('invoices.receipt', compact('invoice'));
}
/**
* Process payment for the specified invoice.
*
@@ -63,7 +84,7 @@ class InvoiceController extends Controller
'status' => 'paid'
]);
return redirect()->route('invoices.show', $invoice->id)
return redirect()->route('bills.show', $invoice->id)
->with('success', 'Payment processed successfully.');
}
@@ -86,7 +107,7 @@ class InvoiceController extends Controller
]);
}
return redirect()->route('invoices.index')
return redirect()->route('bills.index')
->with('success', 'All payments processed successfully.');
}
}