From 30b5f4fa0f43840909452803d1844ed67537e4f5 Mon Sep 17 00:00:00 2001 From: GhassanYusuf Date: Thu, 22 Jan 2026 04:05:52 +0300 Subject: [PATCH] made the add member as a modal not a complete page --- .../Auth/AuthenticatedSessionController.php | 2 +- app/Http/Controllers/FamilyController.php | 5 +- app/Models/User.php | 3 +- ...2_003308_add_deleted_at_to_users_table.php | 28 ++ resources/views/family/create.blade.php | 231 ++++++++++ resources/views/family/dashboard.blade.php | 402 +++++++++++++++++- resources/views/family/show.blade.php | 53 +-- resources/views/layouts/app.blade.php | 74 ++-- 8 files changed, 738 insertions(+), 60 deletions(-) create mode 100644 database/migrations/2026_01_22_003308_add_deleted_at_to_users_table.php diff --git a/app/Http/Controllers/Auth/AuthenticatedSessionController.php b/app/Http/Controllers/Auth/AuthenticatedSessionController.php index fe45eed..923a57a 100644 --- a/app/Http/Controllers/Auth/AuthenticatedSessionController.php +++ b/app/Http/Controllers/Auth/AuthenticatedSessionController.php @@ -59,7 +59,7 @@ class AuthenticatedSessionController extends Controller // ]); // } - return redirect()->route('family.dashboard'); + return redirect()->route('clubs.explore'); } return back()->withErrors([ diff --git a/app/Http/Controllers/FamilyController.php b/app/Http/Controllers/FamilyController.php index b2243ca..f8ef2b1 100644 --- a/app/Http/Controllers/FamilyController.php +++ b/app/Http/Controllers/FamilyController.php @@ -243,7 +243,7 @@ class FamilyController extends Controller { $validated = $request->validate([ 'full_name' => 'required|string|max:255', - 'email' => 'nullable|email|max:255', + 'email' => 'nullable|email|max:255|unique:users,email,' . $id, 'mobile_code' => 'nullable|string|max:5', 'mobile' => 'nullable|string|max:20', 'gender' => 'required|in:m,f', @@ -366,7 +366,8 @@ class FamilyController extends Controller ->where('dependent_user_id', $id) ->firstOrFail(); - $relationship->delete(); + $dependent = User::findOrFail($id); + $dependent->delete(); return redirect()->route('family.dashboard') ->with('success', 'Family member removed successfully.'); diff --git a/app/Models/User.php b/app/Models/User.php index 05a7e19..cea837b 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -5,6 +5,7 @@ namespace App\Models; // use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Auth\MustVerifyEmail; use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Illuminate\Database\Eloquent\Relations\HasMany; @@ -15,7 +16,7 @@ use Carbon\Carbon; class User extends Authenticatable { /** @use HasFactory<\Database\Factories\UserFactory> */ - use HasFactory, Notifiable, MustVerifyEmail; + use HasFactory, Notifiable, MustVerifyEmail, SoftDeletes; /** * The attributes that are mass assignable. diff --git a/database/migrations/2026_01_22_003308_add_deleted_at_to_users_table.php b/database/migrations/2026_01_22_003308_add_deleted_at_to_users_table.php new file mode 100644 index 0000000..a7bda58 --- /dev/null +++ b/database/migrations/2026_01_22_003308_add_deleted_at_to_users_table.php @@ -0,0 +1,28 @@ +softDeletes(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + $table->dropSoftDeletes(); + }); + } +}; diff --git a/resources/views/family/create.blade.php b/resources/views/family/create.blade.php index b49c9cc..fe1af84 100644 --- a/resources/views/family/create.blade.php +++ b/resources/views/family/create.blade.php @@ -28,6 +28,28 @@ @enderror +
+ +
+ + + + +
+ @error('mobile') +
{{ $message }}
+ @enderror + @error('mobile_code') +
{{ $message }}
+ @enderror +
+
@@ -78,6 +100,78 @@
+
+
+ Social Media Links + +
+ +
+ +
+ + +
Share a personal motto or quote that inspires them.
+ @error('motto') +
{{ $message }}
+ @enderror +
+
@@ -110,4 +204,141 @@
+ + + +@push('scripts') + +@endpush + @endsection diff --git a/resources/views/family/dashboard.blade.php b/resources/views/family/dashboard.blade.php index 752623c..27ed9e3 100644 --- a/resources/views/family/dashboard.blade.php +++ b/resources/views/family/dashboard.blade.php @@ -273,12 +273,12 @@
@@ -347,6 +347,209 @@ + + + @endsection diff --git a/resources/views/family/show.blade.php b/resources/views/family/show.blade.php index 745a36a..522a0f9 100644 --- a/resources/views/family/show.blade.php +++ b/resources/views/family/show.blade.php @@ -8,35 +8,17 @@

Member Profile

Comprehensive member information and analytics

-
- -
-
+
-
+
@if($relationship->dependent->media_gallery[0] ?? false) - {{ $relationship->dependent->full_name }} + {{ $relationship->dependent->full_name }} @else -
+
{{ strtoupper(substr($relationship->dependent->full_name, 0, 1)) }}
@endif @@ -46,9 +28,30 @@

{{ $relationship->dependent->full_name }}

- + @if($relationship->relationship_type == 'self' || Auth::id() == $relationship->guardian_user_id) + + @else + + @endif
@if($relationship->dependent->motto)

"{{ $relationship->dependent->motto }}"

diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 7f996c4..00df68f 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -178,15 +178,15 @@ border-color: hsl(var(--primary-hover)); } .user-avatar { - width: 32px; - height: 32px; + width: 40px; + height: 40px; border-radius: 50%; object-fit: cover; margin-right: 8px; } .user-avatar-placeholder { - width: 32px; - height: 32px; + width: 40px; + height: 40px; border-radius: 50%; background-color: hsl(var(--primary)); color: hsl(var(--primary-foreground)); @@ -196,6 +196,23 @@ margin-right: 8px; font-weight: 600; } + .avatar-container { + position: relative; + display: inline-block; + } + .online-indicator { + position: absolute; + bottom: -2px; + right: -2px; + width: 10px; + height: 10px; + background-color: #28a745; + border-radius: 50%; + border: 2px solid white; + } + .dropdown-toggle::after { + display: none; + } .dropdown-toggle { display: flex; align-items: center; @@ -205,10 +222,13 @@ padding: 0.5rem; margin: 0 0.25rem; border-radius: 50%; - transition: background-color 0.2s; + transition: transform 0.2s; + display: flex; + align-items: center; + justify-content: center; } .nav-icon-btn:hover { - background-color: #f8f9fa; + transform: scale(1.1); } .notification-badge { position: absolute; @@ -234,15 +254,21 @@ padding: 0.75rem 1rem; border-bottom: 1px solid hsl(var(--border)); transition: background-color 0.2s; + cursor: pointer; + background-color: white; } .notification-item:hover { - background-color: hsl(var(--muted)); + background-color: hsl(var(--primary)) !important; + color: hsl(var(--primary-foreground)) !important; + } + .notification-item:hover .text-muted { + color: hsl(var(--primary-foreground)) !important; } .notification-item:last-child { border-bottom: none; } .notification-item.unread { - background-color: hsl(var(--accent)); + background-color: white; } .dropdown-item:hover { @@ -330,34 +356,24 @@ 2d
- View All Notifications
@endauth - @guest - @if (Route::has('login')) - - @endif - - @if (Route::has('register')) - - @endif - @else + @auth