public function scopeSecondary($query, $accountGatewaysIds) { $query->where('payment_library_id', '=', 1)->where('id', '!=', GATEWAY_WEPAY)->whereNotIn('id', static::$preferred)->whereIn('id', $accountGatewaysIds); }