Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
makssein committed Aug 27, 2023
1 parent 3913e99 commit 3c5d8ca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Http/Controllers/Web/Follow/FollowsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
class FollowsController extends Controller
{
public function follow(User $user) {
if(auth()->user()->is($user)) { //нельзя подписаться на себя же
return response()->json([
'status' => true
]);
}

auth()->user()->toggleFollow($user);

return response()->json([
Expand Down

0 comments on commit 3c5d8ca

Please sign in to comment.