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)129.4k↓75.8%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 3d 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

36

—

LowBetter than 79% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity28

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

632d 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

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M195](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)

PHPackages © 2026

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