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

+7 -9
View File
@@ -54,9 +54,9 @@ class ClubController extends Controller
'gps_lat' => (float) $club->gps_lat,
'gps_long' => (float) $club->gps_long,
'distance' => round($distance, 2), // distance in kilometers
'owner_name' => $club->owner->full_name,
'owner_email' => $club->owner->email,
'owner_mobile' => $club->owner->mobile,
'owner_name' => $club->owner ? $club->owner->full_name : 'N/A',
'owner_email' => $club->owner ? $club->owner->email : null,
'owner_mobile' => $club->owner ? $club->owner->mobile : null,
];
});
@@ -107,9 +107,7 @@ class ClubController extends Controller
*/
public function all()
{
$clubs = Tenant::whereNotNull('gps_lat')
->whereNotNull('gps_long')
->with('owner')
$clubs = Tenant::with('owner')
->get()
->map(function ($club) {
return [
@@ -117,9 +115,9 @@ class ClubController extends Controller
'club_name' => $club->club_name,
'slug' => $club->slug,
'logo' => $club->logo,
'gps_lat' => (float) $club->gps_lat,
'gps_long' => (float) $club->gps_long,
'owner_name' => $club->owner->full_name,
'gps_lat' => $club->gps_lat ? (float) $club->gps_lat : null,
'gps_long' => $club->gps_long ? (float) $club->gps_long : null,
'owner_name' => $club->owner ? $club->owner->full_name : 'N/A',
];
});
+1 -2
View File
@@ -31,9 +31,8 @@ class FamilyController extends Controller
->sortBy(function($relationship) {
return $relationship->dependent->full_name;
});
$familyInvoices = $this->familyService->getFamilyInvoices($user->id);
return view('family.dashboard', compact('user', 'dependents', 'familyInvoices'));
return view('family.dashboard', compact('user', 'dependents'));
}
/**
+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.');
}
}