From 66f88977e155330d0aad432249dcb53cb8ff70d9 Mon Sep 17 00:00:00 2001 From: Jaton David Date: Thu, 7 Nov 2024 10:24:57 +0100 Subject: [PATCH 1/2] Delete a user --- .../Controllers/FriendshipsController.php | 30 ++++++++++++++----- resources/views/friendships/index.blade.php | 18 +++++++---- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/app/Http/Controllers/FriendshipsController.php b/app/Http/Controllers/FriendshipsController.php index 3217d2f..747dbb6 100644 --- a/app/Http/Controllers/FriendshipsController.php +++ b/app/Http/Controllers/FriendshipsController.php @@ -37,14 +37,14 @@ public function create() public function pending() { $pendingRequestsFromFriends = Friendship::where('friend_id', Auth::id()) - ->where('status', 'pending') - ->with('user', 'friend') - ->get(); + ->where('status', 'pending') + ->with('user', 'friend') + ->get(); $pendingRequestsFromUser = Friendship::where('user_id', Auth::id()) - ->where('status', 'pending') - ->with(['user', 'friend']) - ->get(); + ->where('status', 'pending') + ->with(['user', 'friend']) + ->get(); $pendingRequests = $pendingRequestsFromFriends->merge($pendingRequestsFromUser); @@ -111,7 +111,21 @@ public function decline(Request $request, $friendship_id) return back()->with('error', 'Could not decline the friend request.'); } - public function removeFriend(Request $request) + public function destroy($friend) { - } + $friendship = Friendship::where(function ($query) use ($friend) { + $query->where('user_id', Auth::id()) + ->where('friend_id', $friend); + })->orWhere(function ($query) use ($friend) { + $query->where('user_id', $friend) + ->where('friend_id', Auth::id()); + })->first(); + + if ($friendship) { + $friendship->delete(); + return back()->with('success', 'Friend removed successfully!'); + } + + return back()->with('error', 'Could not find the friend to remove.'); + } } diff --git a/resources/views/friendships/index.blade.php b/resources/views/friendships/index.blade.php index 5169b58..034e872 100644 --- a/resources/views/friendships/index.blade.php +++ b/resources/views/friendships/index.blade.php @@ -26,12 +26,18 @@
- - + + + +
+ @csrf + @method('DELETE') + +
@endforeach From 2afbf5c4ed934aaa310b5412286e5a3a8eb790dd Mon Sep 17 00:00:00 2001 From: Jaton David Date: Tue, 12 Nov 2024 09:44:01 +0100 Subject: [PATCH 2/2] Block a user --- .../Controllers/FriendshipsController.php | 45 +++++++++++++++--- public/source/assets/images/block_icon.png | Bin 0 -> 21317 bytes resources/views/friendships/index.blade.php | 7 +++ routes/web.php | 2 +- 4 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 public/source/assets/images/block_icon.png diff --git a/app/Http/Controllers/FriendshipsController.php b/app/Http/Controllers/FriendshipsController.php index 747dbb6..3a8d296 100644 --- a/app/Http/Controllers/FriendshipsController.php +++ b/app/Http/Controllers/FriendshipsController.php @@ -74,7 +74,7 @@ public function store(Request $request) })->exists(); if ($friendshipExists) { - return back()->with('error', 'You are already friends or a request is pending.'); + return back()->with('error', 'You are already friends, blocked or a request is pending.'); } Friendship::create([ @@ -115,17 +115,50 @@ public function destroy($friend) { $friendship = Friendship::where(function ($query) use ($friend) { $query->where('user_id', Auth::id()) - ->where('friend_id', $friend); + ->where('friend_id', $friend); })->orWhere(function ($query) use ($friend) { $query->where('user_id', $friend) - ->where('friend_id', Auth::id()); + ->where('friend_id', Auth::id()); })->first(); - + if ($friendship) { $friendship->delete(); return back()->with('success', 'Friend removed successfully!'); } - + return back()->with('error', 'Could not find the friend to remove.'); - } + } + + public function block($friend) + { + $friend = User::findOrFail($friend); + + if ($friend->id === Auth::id()) { + return back()->with('error', 'You cannot block yourself.'); + } + + $friendship = Friendship::where(function ($query) use ($friend) { + $query->where('user_id', auth()->id()) + ->where('friend_id', $friend->id); + })->orWhere(function ($query) use ($friend) { + $query->where('user_id', $friend->id) + ->where('friend_id', auth()->id()); + })->first(); + + if ($friendship) { + if ($friendship->status === 'blocked') { + return back()->with('error', 'This user is already blocked.'); + } + $friendship->update(['status' => 'blocked']); + return back()->with('success', 'User blocked successfully!'); + } else { + // Create a new friendship with 'blocked' status if no existing relation is found + Friendship::create([ + 'user_id' => auth()->id(), + 'friend_id' => $friend->id, + 'status' => 'blocked', + ]); + return back()->with('success', 'User blocked successfully!'); + } + } } diff --git a/public/source/assets/images/block_icon.png b/public/source/assets/images/block_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..42d4d2e36824e6348e0b9ada692ad18e6add484e GIT binary patch literal 21317 zcmcG#by$^8*FQ=KC?KWM8DZqh?Ib+G@A|)>24Gdr9-+yO1hgf z_&n!%-}iUUALly1>-Ptj?t9j(S+mw>eP+$vb4RGF%00v;$3{Uxd8i;St%-tydUW@9 z9}_(38Jmv;|2%M(*LOof!RxsDLyc#~qd-Bqr*EsRhtN||hFZcM+00+TEnsY3j?O?D z1w~lQ%h}x09)@^o0kgJs5@FnJY-N0E`$~jSmsf>D#aRkwV=M3D3e)mY)wcApw-kKE zC?<+6>;(l19AOCar(TW@PHs>y5yroIq2T{_kJ%Z4kn1ZesHU{+zeT_=5k?yX!WqiW z?&;~t=E==ip-J;$j67tZv>;2y-u1CpTK40sHA+9nvs2OIKTGge~0Z z>77n<3%EN%gpm>Z>AzJ=AP}y$7XQ)iIcV<0(D*P{b zsKhI`yPy9WL<{Ef_s73}IoSRk$=Tf14W{kw3=?70gt@`pT`ggMHQaUjw-PB=m^lLW zN|cL(i-(nyla+&CnEiigx*OxaI>>k-6kdsP^8QEcUl0DLkgNre;pO7x;^P(M<_B-D>*#2wEe}DXY&j0E0FNgd~@V`0z z|9c=_S^g&o&hD-be*^r=k{#v%bA&k|?n1!%?-0DQgd%Ja4zT|UfP@3$e+B>`3+iC* zWG%wz#rg_nW$x~PU=-D6)w%o6Q`V<<9{hjI=-*0&+5emV|Bd-L|2NFuq3Uny+~El{ zfXQ(Gdoth`RKgu$19uhGv2}1TcZJ!(pQ@O9**e06??nIaMu6wPCjbBPEl9ZkIQM_p z;$`mq->?nDpnow5ch!c&9Ym$fojlB+KG%dfy@I*IT$zN~|5u6sSF8SID9B!r$L#;f zcJSjrd;t`SFuDRZ@Kpbug@U5`UO`$y+beBr*85%RsrlSKdr2qNgl|1#DLs?MM;WFH zq=BaXBz#tpia%nx$i-Aw^$!D5K*hhx#k7y7FV~Ubk$~uu0=L4*FYcC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cVEF+={Bq)wo2f77g%|B&EbwX~NoQ@kViW<@d*f6B zOotGRDKZNgTQzW1RuEW%qcH57kqNXK&?hEKdUv#ervWFV2>?F&*&g(ph#g0wJoR&i z>987|BSG7LcuR%LP8#AG86M4VCCkq&8?iKSZB6%iU%M7yGLUQT!NijYu~{-JN9Nwn zcHj54I5=MBGiK5c-(vD$X1<2@+R#4zbj>0`&g;1lZc=QL#{_N+69yz35u(}nhp$f> zU{~!$8KDhh85`-gm!^S`qi2%at(-*i5`&_bVqWc)*v+<(PgD+OcmfJ4%B89=ylOE* zDm!g&9$w<4>*rBsiAU@zb7!mI^5}S-_+`_U?G39b=dpr9jR1d(-0r!R^7KB97BNFF zWLq6Vzs>BLISV+VzzZ4yQpu0qoF5X?g~833!yMKqi6dE#!55o%8m_4C3W@7xnnULl+k7gJ|BV z|4Cz9)Cf4UHn)2WHMEESPJ(iNwoWH+113@X40c+-z2T$gC+xsB0&9}*W83S&?@PS7 zAd0ZgS`(!j|5Lp3^qnADm*OJJag9VSWM$WMyXFIp!>zLzIpliUXeKHXR=&IckWE$q zHK_cG2YtBD<7~53yMSU=z`CUC`p@Aw#>NPnOt&Y1w1S$iZWZve9xcpZi=PCq7v#GD zmB0b*iIPMy!bA)+?0*2W<+o3gI%OTWY5Ec87nZGmDUMTds-}sD$_RVpo0SKQCjSZ_ z+Z@#R@T+VIop@!ju#75_sVsQHn}O?GGlg$wQDEBu8~Q?W*f$Y>TR5@pdY96=+uSDJ z>5kdD3?`0St~0p>*Z9;LPTSsh142y~(7nl)g};xW51_B!``WS)ef7}67n8>#UnoV34pLg1mnduYOO&-q zw1TphroBX2JF`St8&* + +
+ @csrf + +
@endforeach diff --git a/routes/web.php b/routes/web.php index fb6db74..14edbe4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -28,7 +28,7 @@ Route::get('/friends/pending', [FriendshipsController::class, 'pending'])->name('friends.pending'); Route::post('/friends/{friendship_id}/accept', [FriendshipsController::class, 'accept'])->name('friends.accept'); Route::post('/friends/{friendship_id}/decline', [FriendshipsController::class, 'decline'])->name('friends.decline'); - + Route::post('/friends/{friend}/block', [FriendshipsController::class, 'block'])->name('friends.block'); });