mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-01 16:00:53 -05:00
Remove the option to follow yourself
This commit is contained in:
@@ -31,7 +31,9 @@ class FollowController extends Controller
|
||||
*/
|
||||
public function follow(User $user)
|
||||
{
|
||||
if (!Auth::user()->isFollowing($user->id)) {
|
||||
if (Auth::user()->id == $user->id) {
|
||||
return back()->with(Toastr::error("Nice try, but sadly you can not follow yourself.", 'Error!', ['options']));
|
||||
} elseif (!Auth::user()->isFollowing($user->id)) {
|
||||
// Create a new follow instance for the authenticated user
|
||||
Auth::user()->follows()->create([
|
||||
'target_id' => $user->id,
|
||||
|
||||
Reference in New Issue
Block a user