Laravel.io
public function getUsersList($requestOnly)
    {
        $this->requestOnly = $requestOnly;
        $userAll = $this->select(
                'users.id', 'users.name', 'users.email',
                'users.city_id', 'users.affiliate_id', 'status', 'cities.city'
            )
            ->JoinCity()
            ->WhereListUser()
            ->with('groups')
            ->with('affiliate')
            ->with('session')
            ->get();
        return $userAll;
    }

    function scopeJoinCity($query)
    {
        return $query->join('cities', 'users.city_id', '=', 'cities.id');
    }

    function scopeWhereListUser($query)
    {
        $r = $this->requestOnly;

        // выборки
        if($r['status']=='хз') {
            $query->where('users.status', '=', $r['status']);
        }
        return $query;
    }

Please note that all pasted data is publicly available.