You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to request a new feature for the library to include a method that allows querying friendships without filtering by a specific status. The current implementation only allows querying by a specific status, which limits the flexibility of the querying capabilities.
/**
* Get the query builder of the 'friend' model
*
* @param string $groupSlug
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function getFriendsQueryBuilder($groupSlug = '')
{
$friendships = $this->findFriendships(Status::ACCEPTED, $groupSlug)->get(['sender_id', 'recipient_id']);
$recipients = $friendships->pluck('recipient_id')->all();
$senders = $friendships->pluck('sender_id')->all();
Proposed Solution:
Here is an example of how the new method can be implemented:
/**
* Get the query builder of the 'friend' model
*
* @param string $status
* @param string $groupSlug
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function getFriendsQueryBuilder(status = Status::ACCEPTED,$groupSlug = '')
{
$friendships = $this->findFriendships($status, $groupSlug)->get(['sender_id', 'recipient_id']);
$recipients = $friendships->pluck('recipient_id')->all();
$senders = $friendships->pluck('sender_id')->all();
Hello,
I would like to request a new feature for the library to include a method that allows querying friendships without filtering by a specific status. The current implementation only allows querying by a specific status, which limits the flexibility of the querying capabilities.
/**
* Get the query builder of the 'friend' model
*
* @param string $groupSlug
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function getFriendsQueryBuilder($groupSlug = '')
{
$friendships = $this->findFriendships(Status::ACCEPTED, $groupSlug)->get(['sender_id', 'recipient_id']);
$recipients = $friendships->pluck('recipient_id')->all();
$senders = $friendships->pluck('sender_id')->all();
Proposed Solution:
Here is an example of how the new method can be implemented:
/**
* Get the query builder of the 'friend' model
*
* @param string $status
* @param string $groupSlug
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function getFriendsQueryBuilder(status = Status::ACCEPTED,$groupSlug = '')
{
$friendships = $this->findFriendships($status, $groupSlug)->get(['sender_id', 'recipient_id']);
$recipients = $friendships->pluck('recipient_id')->all();
$senders = $friendships->pluck('sender_id')->all();
The text was updated successfully, but these errors were encountered: