using cloude sonet 3.5 i have used the prompt to create the migrations and their files and installed api package
This commit is contained in:
1 parent
f27b5abf02
commit
4a7353e3fc
23 files changed
+1871
-2
No files matched your search
@@ -0,0 +1,101 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-white">
|
||||
<h4 class="mb-0">Add Family Member</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('family.store') }}">
|
||||
@csrf
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="full_name" class="form-label">Full Name</label>
|
||||
<input type="text" class="form-control @error('full_name') is-invalid @enderror" id="full_name" name="full_name" value="{{ old('full_name') }}" required>
|
||||
@error('full_name')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email Address <span class="text-muted">(Optional for children)</span></label>
|
||||
<input type="email" class="form-control @error('email') is-invalid @enderror" id="email" name="email" value="{{ old('email') }}">
|
||||
@error('email')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="gender" class="form-label">Gender</label>
|
||||
<select class="form-select @error('gender') is-invalid @enderror" id="gender" name="gender" required>
|
||||
<option value="">Select Gender</option>
|
||||
<option value="male" {{ old('gender') == 'male' ? 'selected' : '' }}>Male</option>
|
||||
<option value="female" {{ old('gender') == 'female' ? 'selected' : '' }}>Female</option>
|
||||
</select>
|
||||
@error('gender')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="birthdate" class="form-label">Birthdate</label>
|
||||
<input type="date" class="form-control @error('birthdate') is-invalid @enderror" id="birthdate" name="birthdate" value="{{ old('birthdate') }}" required>
|
||||
@error('birthdate')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="blood_type" class="form-label">Blood Type <span class="text-muted">(Optional)</span></label>
|
||||
<input type="text" class="form-control @error('blood_type') is-invalid @enderror" id="blood_type" name="blood_type" value="{{ old('blood_type') }}">
|
||||
@error('blood_type')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="nationality" class="form-label">Nationality</label>
|
||||
<input type="text" class="form-control @error('nationality') is-invalid @enderror" id="nationality" name="nationality" value="{{ old('nationality') }}" required>
|
||||
@error('nationality')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="relationship_type" class="form-label">Relationship</label>
|
||||
<select class="form-select @error('relationship_type') is-invalid @enderror" id="relationship_type" name="relationship_type" required>
|
||||
<option value="">Select Relationship</option>
|
||||
<option value="son" {{ old('relationship_type') == 'son' ? 'selected' : '' }}>Son</option>
|
||||
<option value="daughter" {{ old('relationship_type') == 'daughter' ? 'selected' : '' }}>Daughter</option>
|
||||
<option value="spouse" {{ old('relationship_type') == 'spouse' ? 'selected' : '' }}>Spouse</option>
|
||||
<option value="sponsor" {{ old('relationship_type') == 'sponsor' ? 'selected' : '' }}>Sponsor</option>
|
||||
<option value="other" {{ old('relationship_type') == 'other' ? 'selected' : '' }}>Other</option>
|
||||
</select>
|
||||
@error('relationship_type')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 form-check">
|
||||
<input type="checkbox" class="form-check-input" id="is_billing_contact" name="is_billing_contact" value="1" {{ old('is_billing_contact') ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_billing_contact">Is Billing Contact</label>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
<a href="{{ route('family.dashboard') }}" class="btn btn-outline-secondary">Cancel</a>
|
||||
<button type="submit" class="btn btn-primary">Add Family Member</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,153 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container py-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1 class="mb-0">My Family</h1>
|
||||
<div>
|
||||
<a href="{{ route('invoices.index') }}" class="btn btn-outline-primary">
|
||||
<i class="bi bi-receipt"></i> All Invoices
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Family Members Card Grid -->
|
||||
<div class="row row-cols-1 row-cols-md-3 g-4 mb-5">
|
||||
<!-- Current User Card -->
|
||||
<div class="col">
|
||||
<div class="card h-100 shadow-sm">
|
||||
<div class="card-body text-center">
|
||||
<div class="mb-3">
|
||||
<img src="{{ $user->media_gallery[0] ?? 'https://via.placeholder.com/150' }}"
|
||||
class="rounded-circle" alt="{{ $user->full_name }}"
|
||||
width="100" height="100">
|
||||
</div>
|
||||
<h5 class="card-title">{{ $user->full_name }}</h5>
|
||||
<p class="card-text text-muted">
|
||||
Age: {{ $user->age }} ({{ $user->life_stage }})
|
||||
</p>
|
||||
<p class="card-text">
|
||||
<small class="text-muted">{{ $user->horoscope }}</small>
|
||||
</p>
|
||||
<a href="{{ route('profile.edit') }}" class="btn btn-primary">
|
||||
<i class="bi bi-pencil"></i> Edit Profile
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Dependents Cards -->
|
||||
@foreach($dependents as $relationship)
|
||||
<div class="col">
|
||||
<div class="card h-100 shadow-sm">
|
||||
<div class="card-body text-center">
|
||||
<div class="mb-3">
|
||||
<img src="{{ $relationship->dependent->media_gallery[0] ?? 'https://via.placeholder.com/150' }}"
|
||||
class="rounded-circle" alt="{{ $relationship->dependent->full_name }}"
|
||||
width="100" height="100">
|
||||
</div>
|
||||
<h5 class="card-title">{{ $relationship->dependent->full_name }}</h5>
|
||||
<p class="card-text text-muted">
|
||||
Age: {{ $relationship->dependent->age }} ({{ $relationship->dependent->life_stage }})
|
||||
</p>
|
||||
<span class="badge bg-secondary">{{ ucfirst($relationship->relationship_type) }}</span>
|
||||
</div>
|
||||
<div class="card-footer bg-transparent border-top-0 text-center">
|
||||
<div class="btn-group" role="group">
|
||||
<a href="{{ route('family.edit', $relationship->dependent->id) }}" class="btn btn-sm btn-outline-secondary">
|
||||
<i class="bi bi-pencil"></i> Edit
|
||||
</a>
|
||||
<a href="{{ route('family.show', $relationship->dependent->id) }}" class="btn btn-sm btn-outline-primary">
|
||||
<i class="bi bi-eye"></i> View
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<!-- Add New Family Member Card -->
|
||||
<div class="col">
|
||||
<div class="card h-100 shadow-sm border-dashed">
|
||||
<a href="{{ route('family.create') }}" class="card-body text-center text-decoration-none d-flex flex-column justify-content-center align-items-center" style="height: 100%;">
|
||||
<div class="mb-3">
|
||||
<i class="bi bi-plus-circle" style="font-size: 3rem;"></i>
|
||||
</div>
|
||||
<h5 class="card-title text-muted">Add Family Member</h5>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Family Payments Table -->
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header bg-white">
|
||||
<h4 class="mb-0">Family Payments</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Student Name</th>
|
||||
<th>Class/Package</th>
|
||||
<th>Amount</th>
|
||||
<th>Status</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($familyInvoices as $invoice)
|
||||
<tr>
|
||||
<td>{{ $invoice->student->full_name }}</td>
|
||||
<td>{{ $invoice->tenant->club_name }}</td>
|
||||
<td>${{ number_format($invoice->amount, 2) }}</td>
|
||||
<td>
|
||||
@if($invoice->status === 'paid')
|
||||
<span class="badge bg-success">Paid</span>
|
||||
@elseif($invoice->status === 'pending')
|
||||
<span class="badge bg-warning text-dark">Pending</span>
|
||||
@else
|
||||
<span class="badge bg-danger">Overdue</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('invoices.show', $invoice->id) }}" class="btn btn-sm btn-outline-primary">
|
||||
<i class="bi bi-eye"></i> View
|
||||
</a>
|
||||
@if($invoice->status !== 'paid')
|
||||
<a href="{{ route('invoices.pay', $invoice->id) }}" class="btn btn-sm btn-success">
|
||||
<i class="bi bi-credit-card"></i> Pay
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="5" class="text-center py-4">
|
||||
<p class="text-muted mb-0">No payments due at this time.</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-white d-flex justify-content-end">
|
||||
@if(count($familyInvoices->where('status', '!=', 'paid')) > 0)
|
||||
<a href="{{ route('invoices.pay-all') }}" class="btn btn-success">
|
||||
<i class="bi bi-credit-card"></i> Pay All
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.border-dashed {
|
||||
border-style: dashed !important;
|
||||
border-width: 2px !important;
|
||||
border-color: #dee2e6 !important;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
@@ -0,0 +1,130 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-white">
|
||||
<h4 class="mb-0">Edit Family Member</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('family.update', $relationship->dependent->id) }}">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="full_name" class="form-label">Full Name</label>
|
||||
<input type="text" class="form-control @error('full_name') is-invalid @enderror" id="full_name" name="full_name" value="{{ old('full_name', $relationship->dependent->full_name) }}" required>
|
||||
@error('full_name')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email Address <span class="text-muted">(Optional for children)</span></label>
|
||||
<input type="email" class="form-control @error('email') is-invalid @enderror" id="email" name="email" value="{{ old('email', $relationship->dependent->email) }}">
|
||||
@error('email')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="gender" class="form-label">Gender</label>
|
||||
<select class="form-select @error('gender') is-invalid @enderror" id="gender" name="gender" required>
|
||||
<option value="">Select Gender</option>
|
||||
<option value="male" {{ old('gender', $relationship->dependent->gender) == 'male' ? 'selected' : '' }}>Male</option>
|
||||
<option value="female" {{ old('gender', $relationship->dependent->gender) == 'female' ? 'selected' : '' }}>Female</option>
|
||||
</select>
|
||||
@error('gender')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="birthdate" class="form-label">Birthdate</label>
|
||||
<input type="date" class="form-control @error('birthdate') is-invalid @enderror" id="birthdate" name="birthdate" value="{{ old('birthdate', $relationship->dependent->birthdate->format('Y-m-d')) }}" required>
|
||||
@error('birthdate')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="blood_type" class="form-label">Blood Type <span class="text-muted">(Optional)</span></label>
|
||||
<input type="text" class="form-control @error('blood_type') is-invalid @enderror" id="blood_type" name="blood_type" value="{{ old('blood_type', $relationship->dependent->blood_type) }}">
|
||||
@error('blood_type')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="nationality" class="form-label">Nationality</label>
|
||||
<input type="text" class="form-control @error('nationality') is-invalid @enderror" id="nationality" name="nationality" value="{{ old('nationality', $relationship->dependent->nationality) }}" required>
|
||||
@error('nationality')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="relationship_type" class="form-label">Relationship</label>
|
||||
<select class="form-select @error('relationship_type') is-invalid @enderror" id="relationship_type" name="relationship_type" required>
|
||||
<option value="">Select Relationship</option>
|
||||
<option value="son" {{ old('relationship_type', $relationship->relationship_type) == 'son' ? 'selected' : '' }}>Son</option>
|
||||
<option value="daughter" {{ old('relationship_type', $relationship->relationship_type) == 'daughter' ? 'selected' : '' }}>Daughter</option>
|
||||
<option value="spouse" {{ old('relationship_type', $relationship->relationship_type) == 'spouse' ? 'selected' : '' }}>Spouse</option>
|
||||
<option value="sponsor" {{ old('relationship_type', $relationship->relationship_type) == 'sponsor' ? 'selected' : '' }}>Sponsor</option>
|
||||
<option value="other" {{ old('relationship_type', $relationship->relationship_type) == 'other' ? 'selected' : '' }}>Other</option>
|
||||
</select>
|
||||
@error('relationship_type')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 form-check">
|
||||
<input type="checkbox" class="form-check-input" id="is_billing_contact" name="is_billing_contact" value="1" {{ old('is_billing_contact', $relationship->is_billing_contact) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_billing_contact">Is Billing Contact</label>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
<a href="{{ route('family.dashboard') }}" class="btn btn-outline-secondary">Cancel</a>
|
||||
<div>
|
||||
<button type="button" class="btn btn-danger me-2" data-bs-toggle="modal" data-bs-target="#deleteModal">
|
||||
Remove
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary">Update Family Member</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Delete Confirmation Modal -->
|
||||
<div class="modal fade" id="deleteModal" tabindex="-1" aria-labelledby="deleteModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="deleteModalLabel">Confirm Removal</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Are you sure you want to remove {{ $relationship->dependent->full_name }} from your family?
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<form action="{{ route('family.destroy', $relationship->dependent->id) }}" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-danger">Remove</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,157 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-white d-flex justify-content-between align-items-center">
|
||||
<h4 class="mb-0">Family Member Details</h4>
|
||||
<a href="{{ route('family.dashboard') }}" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-arrow-left"></i> Back to Family
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="text-center mb-4">
|
||||
<img src="{{ $relationship->dependent->media_gallery[0] ?? 'https://via.placeholder.com/150' }}"
|
||||
class="rounded-circle mb-3" alt="{{ $relationship->dependent->full_name }}"
|
||||
width="120" height="120">
|
||||
<h3>{{ $relationship->dependent->full_name }}</h3>
|
||||
<span class="badge bg-secondary">{{ ucfirst($relationship->relationship_type) }}</span>
|
||||
@if($relationship->is_billing_contact)
|
||||
<span class="badge bg-info ms-2">Billing Contact</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted">Age</h6>
|
||||
<p>{{ $relationship->dependent->age }} years ({{ $relationship->dependent->life_stage }})</p>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted">Birthdate</h6>
|
||||
<p>{{ $relationship->dependent->birthdate->format('F j, Y') }}</p>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted">Gender</h6>
|
||||
<p>{{ ucfirst($relationship->dependent->gender) }}</p>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted">Horoscope</h6>
|
||||
<p>{{ $relationship->dependent->horoscope }}</p>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted">Nationality</h6>
|
||||
<p>{{ $relationship->dependent->nationality }}</p>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted">Blood Type</h6>
|
||||
<p>{{ $relationship->dependent->blood_type ?? 'Not specified' }}</p>
|
||||
</div>
|
||||
@if($relationship->dependent->email)
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted">Email</h6>
|
||||
<p>{{ $relationship->dependent->email }}</p>
|
||||
</div>
|
||||
@endif
|
||||
@if($relationship->dependent->mobile)
|
||||
<div class="col-md-6 mb-3">
|
||||
<h6 class="text-muted">Mobile</h6>
|
||||
<p>{{ $relationship->dependent->mobile }}</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end mt-3">
|
||||
<a href="{{ route('family.edit', $relationship->dependent->id) }}" class="btn btn-primary">
|
||||
<i class="bi bi-pencil"></i> Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Memberships -->
|
||||
<div class="card shadow-sm mt-4">
|
||||
<div class="card-header bg-white">
|
||||
<h5 class="mb-0">Club Memberships</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($relationship->dependent->memberClubs->count() > 0)
|
||||
<div class="list-group">
|
||||
@foreach($relationship->dependent->memberClubs as $club)
|
||||
<div class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<h6 class="mb-1">{{ $club->club_name }}</h6>
|
||||
<small class="text-muted">Status: {{ ucfirst($club->pivot->status) }}</small>
|
||||
</div>
|
||||
<span class="badge bg-{{ $club->pivot->status === 'active' ? 'success' : 'secondary' }} rounded-pill">
|
||||
{{ ucfirst($club->pivot->status) }}
|
||||
</span>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<p class="text-center text-muted my-4">No club memberships found.</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Invoices -->
|
||||
<div class="card shadow-sm mt-4">
|
||||
<div class="card-header bg-white">
|
||||
<h5 class="mb-0">Recent Invoices</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($relationship->dependent->studentInvoices->count() > 0)
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Club</th>
|
||||
<th>Amount</th>
|
||||
<th>Status</th>
|
||||
<th>Due Date</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($relationship->dependent->studentInvoices->take(5) as $invoice)
|
||||
<tr>
|
||||
<td>{{ $invoice->tenant->club_name }}</td>
|
||||
<td>${{ number_format($invoice->amount, 2) }}</td>
|
||||
<td>
|
||||
@if($invoice->status === 'paid')
|
||||
<span class="badge bg-success">Paid</span>
|
||||
@elseif($invoice->status === 'pending')
|
||||
<span class="badge bg-warning text-dark">Pending</span>
|
||||
@else
|
||||
<span class="badge bg-danger">Overdue</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $invoice->due_date->format('M j, Y') }}</td>
|
||||
<td>
|
||||
<a href="{{ route('invoices.show', $invoice->id) }}" class="btn btn-sm btn-outline-primary">
|
||||
View
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if($relationship->dependent->studentInvoices->count() > 5)
|
||||
<div class="text-center mt-3">
|
||||
<a href="{{ route('invoices.index') }}" class="btn btn-outline-primary btn-sm">
|
||||
View All Invoices
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<p class="text-center text-muted my-4">No invoices found.</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,97 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container py-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1 class="mb-0">My Invoices</h1>
|
||||
</div>
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-white d-flex justify-content-between align-items-center">
|
||||
<h4 class="mb-0">All Invoices</h4>
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="bi bi-funnel"></i> Filter
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a class="dropdown-item" href="{{ route('invoices.index') }}">All</a></li>
|
||||
<li><a class="dropdown-item" href="{{ route('invoices.index', ['status' => 'pending']) }}">Pending</a></li>
|
||||
<li><a class="dropdown-item" href="{{ route('invoices.index', ['status' => 'paid']) }}">Paid</a></li>
|
||||
<li><a class="dropdown-item" href="{{ route('invoices.index', ['status' => 'overdue']) }}">Overdue</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
{{ session('success') }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($invoices->count() > 0)
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Invoice #</th>
|
||||
<th>Student</th>
|
||||
<th>Club</th>
|
||||
<th>Amount</th>
|
||||
<th>Status</th>
|
||||
<th>Due Date</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($invoices as $invoice)
|
||||
<tr>
|
||||
<td>{{ $invoice->id }}</td>
|
||||
<td>{{ $invoice->student->full_name }}</td>
|
||||
<td>{{ $invoice->tenant->club_name }}</td>
|
||||
<td>${{ number_format($invoice->amount, 2) }}</td>
|
||||
<td>
|
||||
@if($invoice->status === 'paid')
|
||||
<span class="badge bg-success">Paid</span>
|
||||
@elseif($invoice->status === 'pending')
|
||||
<span class="badge bg-warning text-dark">Pending</span>
|
||||
@else
|
||||
<span class="badge bg-danger">Overdue</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $invoice->due_date->format('M j, Y') }}</td>
|
||||
<td>
|
||||
<div class="btn-group" role="group">
|
||||
<a href="{{ route('invoices.show', $invoice->id) }}" class="btn btn-sm btn-outline-primary">
|
||||
<i class="bi bi-eye"></i> View
|
||||
</a>
|
||||
@if($invoice->status !== 'paid')
|
||||
<a href="{{ route('invoices.pay', $invoice->id) }}" class="btn btn-sm btn-success">
|
||||
<i class="bi bi-credit-card"></i> Pay
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="text-center py-5">
|
||||
<i class="bi bi-receipt" style="font-size: 3rem;"></i>
|
||||
<h4 class="mt-3">No Invoices Found</h4>
|
||||
<p class="text-muted">There are no invoices matching your criteria.</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if($invoices->where('status', '!=', 'paid')->count() > 0)
|
||||
<div class="card-footer bg-white d-flex justify-content-end">
|
||||
<a href="{{ route('invoices.pay-all') }}" class="btn btn-success">
|
||||
<i class="bi bi-credit-card"></i> Pay All
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,100 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-white d-flex justify-content-between align-items-center">
|
||||
<h4 class="mb-0">Invoice #{{ $invoice->id }}</h4>
|
||||
<a href="{{ route('invoices.index') }}" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-arrow-left"></i> Back to Invoices
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
{{ session('success') }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<h5>Billed To</h5>
|
||||
<p class="mb-1">{{ Auth::user()->full_name }}</p>
|
||||
<p class="mb-1">{{ Auth::user()->email }}</p>
|
||||
@if(Auth::user()->mobile)
|
||||
<p class="mb-0">{{ Auth::user()->mobile }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5>Invoice Details</h5>
|
||||
<p class="mb-1">Invoice #: {{ $invoice->id }}</p>
|
||||
<p class="mb-1">Due Date: {{ $invoice->due_date->format('F j, Y') }}</p>
|
||||
<p class="mb-0">
|
||||
Status:
|
||||
@if($invoice->status === 'paid')
|
||||
<span class="badge bg-success">Paid</span>
|
||||
@elseif($invoice->status === 'pending')
|
||||
<span class="badge bg-warning text-dark">Pending</span>
|
||||
@else
|
||||
<span class="badge bg-danger">Overdue</span>
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<h5>Club Information</h5>
|
||||
<p class="mb-1">{{ $invoice->tenant->club_name }}</p>
|
||||
<p class="mb-0">{{ $invoice->tenant->owner->full_name }} (Owner)</p>
|
||||
</div>
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5>Student Information</h5>
|
||||
<p class="mb-1">{{ $invoice->student->full_name }}</p>
|
||||
<p class="mb-0">Age: {{ $invoice->student->age }} ({{ $invoice->student->life_stage }})</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive mb-4">
|
||||
<table class="table table-bordered">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<th class="text-end">Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Club Membership Fee - {{ $invoice->tenant->club_name }}</td>
|
||||
<td class="text-end">${{ number_format($invoice->amount, 2) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Total</th>
|
||||
<th class="text-end">${{ number_format($invoice->amount, 2) }}</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
@if($invoice->status !== 'paid')
|
||||
<a href="{{ route('invoices.pay', $invoice->id) }}" class="btn btn-success">
|
||||
<i class="bi bi-credit-card"></i> Pay Now
|
||||
</a>
|
||||
@else
|
||||
<button class="btn btn-outline-success" disabled>
|
||||
<i class="bi bi-check-circle"></i> Paid
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,128 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<title>{{ config('app.name', 'Club SaaS') }}</title>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
|
||||
|
||||
<!-- Custom Styles -->
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
.navbar-brand {
|
||||
font-weight: 600;
|
||||
}
|
||||
.nav-link {
|
||||
font-weight: 500;
|
||||
}
|
||||
.card {
|
||||
border-radius: 10px;
|
||||
border: none;
|
||||
}
|
||||
.card-header {
|
||||
border-radius: 10px 10px 0 0 !important;
|
||||
border-bottom: none;
|
||||
}
|
||||
.btn {
|
||||
border-radius: 5px;
|
||||
padding: 0.5rem 1rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
.btn-primary {
|
||||
background-color: #0d6efd;
|
||||
border-color: #0d6efd;
|
||||
}
|
||||
.btn-primary:hover {
|
||||
background-color: #0b5ed7;
|
||||
border-color: #0a58ca;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{{ url('/') }}">
|
||||
{{ config('app.name', 'Club SaaS') }}
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<!-- Left Side Of Navbar -->
|
||||
<ul class="navbar-nav me-auto">
|
||||
@auth
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ route('family.dashboard') }}">My Family</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ route('invoices.index') }}">Invoices</a>
|
||||
</li>
|
||||
@endauth
|
||||
</ul>
|
||||
|
||||
<!-- Right Side Of Navbar -->
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<!-- Authentication Links -->
|
||||
@guest
|
||||
@if (Route::has('login'))
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (Route::has('register'))
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
|
||||
</li>
|
||||
@endif
|
||||
@else
|
||||
<li class="nav-item dropdown">
|
||||
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
|
||||
{{ Auth::user()->full_name }}
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="{{ route('profile.edit') }}">
|
||||
{{ __('Profile') }}
|
||||
</a>
|
||||
<a class="dropdown-item" href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">
|
||||
{{ __('Logout') }}
|
||||
</a>
|
||||
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
|
||||
@csrf
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
@endguest
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
@yield('content')
|
||||
</main>
|
||||
|
||||
<!-- Bootstrap JS Bundle with Popper -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user