PHPackages                             rmtrin/laravel-cross-database-subqueries - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. rmtrin/laravel-cross-database-subqueries

ActiveLibrary[Database &amp; ORM](/categories/database)

rmtrin/laravel-cross-database-subqueries
========================================

Eloquent cross database compatibility in subqueries

10.1(1y ago)126.6k—7.3%HTMLPHP &gt;=8.2.0

Since Sep 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rafaelmtrindade/laravel-cross-database-subqueries)[ Packagist](https://packagist.org/packages/rmtrin/laravel-cross-database-subqueries)[ RSS](/packages/rmtrin-laravel-cross-database-subqueries/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (7)Versions (6)Used By (0)

Laravel Cross database subqueries
=================================

[](#laravel-cross-database-subqueries)

Eloquent cross database compatibility in subqueries.

Why do I need it?
=================

[](#why-do-i-need-it)

### To use the following Eloquent methods cross databases:

[](#to-use-the-following-eloquent-methods-cross-databases)

- has
- whereHas
- doesntHave
- whereDoesntHave
- withCount (except with prefixes)

Installation
============

[](#installation)

Install with composer

```
composer require rmtrin/laravel-cross-database-subqueries

```

From Laravel 5.5 onwards, it's possible to take advantage of auto-discovery of the service provider. For Laravel versions before 5.5, you must register the service provider in your config/app.php

```
Hoyvoy\CrossDatabase\CrossDatabaseServiceProvider::class,

```

Usage
=====

[](#usage)

In your `Models` extends from:

- Hoyvoy\\CrossDatabase\\Eloquent\\Model

Supported PHP Versions
======================

[](#supported-php-versions)

- &gt;=8.2.0

Supported Databases
===================

[](#supported-databases)

- MySQL
- PostgreSQL
- SQL Server

Issues &amp; Contributing
=========================

[](#issues--contributing)

If you find an issue please report it or contribute by submitting a pull request.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

5

Last Release

585d ago

Major Versions

9.x-dev → 10.12024-10-10

PHP version history (2 changes)10.0PHP &gt;=8.2.0

9.0PHP &gt;=7.1.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/a4fa30968ce8511378fa6776b4c31d3a2389778dd7839b7984ca3dcb9ac130d5?d=identicon)[rmtrin](/maintainers/rmtrin)

---

Top Contributors

[![maguilar92](https://avatars.githubusercontent.com/u/25102127?v=4)](https://github.com/maguilar92 "maguilar92 (29 commits)")[![samuelhoyvoy](https://avatars.githubusercontent.com/u/40167040?v=4)](https://github.com/samuelhoyvoy "samuelhoyvoy (7 commits)")[![rafaelmtrindade](https://avatars.githubusercontent.com/u/65633281?v=4)](https://github.com/rafaelmtrindade "rafaelmtrindade (3 commits)")[![jasonlbeggs](https://avatars.githubusercontent.com/u/25065083?v=4)](https://github.com/jasonlbeggs "jasonlbeggs (2 commits)")[![newtongamajr](https://avatars.githubusercontent.com/u/8673343?v=4)](https://github.com/newtongamajr "newtongamajr (2 commits)")[![jualoppaz](https://avatars.githubusercontent.com/u/5088244?v=4)](https://github.com/jualoppaz "jualoppaz (1 commits)")[![LasseRafn](https://avatars.githubusercontent.com/u/2689341?v=4)](https://github.com/LasseRafn "LasseRafn (1 commits)")[![buglinjo](https://avatars.githubusercontent.com/u/1254208?v=4)](https://github.com/buglinjo "buglinjo (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rmtrin-laravel-cross-database-subqueries/health.svg)

```
[![Health](https://phpackages.com/badges/rmtrin-laravel-cross-database-subqueries/health.svg)](https://phpackages.com/packages/rmtrin-laravel-cross-database-subqueries)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[cybercog/laravel-ban

Laravel Ban simplify blocking and banning Eloquent models.

1.1k651.8k11](/packages/cybercog-laravel-ban)[pdphilip/elasticsearch

An Elasticsearch implementation of Laravel's Eloquent ORM

145360.2k4](/packages/pdphilip-elasticsearch)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
