| @@ 95-104 (lines=10) @@ | ||
| 92 | ->get(); |
|
| 93 | } |
|
| 94 | ||
| 95 | public function friendRequestsReceived() |
|
| 96 | { |
|
| 97 | $senders = Friendship::whereRecipient($this) |
|
| 98 | ->accepted(0) |
|
| 99 | ->get(['requester']) |
|
| 100 | ->toArray(); |
|
| 101 | ||
| 102 | return static::whereIn('id', $senders) |
|
| 103 | ->get(); |
|
| 104 | } |
|
| 105 | ||
| 106 | public function friendRequestsSent() |
|
| 107 | { |
|
| @@ 106-115 (lines=10) @@ | ||
| 103 | ->get(); |
|
| 104 | } |
|
| 105 | ||
| 106 | public function friendRequestsSent() |
|
| 107 | { |
|
| 108 | $recipients = Friendship::whereSender($this) |
|
| 109 | ->accepted(0) |
|
| 110 | ->get(['user_requested']) |
|
| 111 | ->toArray(); |
|
| 112 | ||
| 113 | return static::whereIn('id', $recipients) |
|
| 114 | ->get(); |
|
| 115 | } |
|
| 116 | ||
| 117 | public function isFriendsWith($user) |
|
| 118 | { |
|