PHPackages                             kamalsroor/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. kamalsroor/laravel-cross-database-subqueries

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

kamalsroor/laravel-cross-database-subqueries
============================================

Eloquent cross database compatibility in subqueries

9.0(4y ago)09.9k↓20.7%HTMLPHP &gt;=7.1.3

Since Feb 7Pushed 4y agoCompare

[ Source](https://github.com/Kamalsroor/laravel-cross-database-subqueries)[ Packagist](https://packagist.org/packages/kamalsroor/laravel-cross-database-subqueries)[ RSS](/packages/kamalsroor-laravel-cross-database-subqueries/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (7)Versions (16)Used By (0)

[![Build Status](https://camo.githubusercontent.com/5efc820825937b7b5a07fd4d3d5ec3b55a7e30cd3f962f68a42b53310b418b87/68747470733a2f2f7472617669732d63692e6f72672f686f79766f792f6c61726176656c2d63726f73732d64617461626173652d737562717565726965732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hoyvoy/laravel-cross-database-subqueries) [![Codacy Badge](https://camo.githubusercontent.com/e92d1dac0ace161f1b199b6f923e1b006c9685120788ffb98e9ed61ce773b087/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3565663135326564663133643434343061396363616366393432626265636639)](https://www.codacy.com/app/mario-hoyvoy/laravel-cross-database-subqueries?utm_source=github.com&utm_medium=referral&utm_content=hoyvoy/laravel-cross-database-subqueries&utm_campaign=Badge_Grade) [![StyleCI](https://camo.githubusercontent.com/bb691ff810e2c5bae3f5efc40ec855134a3adee6bc7cded857a0c3cdd0454e7e/68747470733a2f2f7374796c6563692e696f2f7265706f732f3132303436363530342f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/120466504)

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

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

Eloquent cross database compatibility in subqueries.

**Laravel****laravel-cross-database-subqueries****Lifecycle**^5.5^5.5January 24, 2017Bug fixes until January 2019Security fixes until June 2020^5.6^5.6February 7, 20186 months of bug fixes1 year of security^8.0^8.0September 22, 2020Why 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 hoyvoy/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;=7.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

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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 ~117 days

Recently: every ~349 days

Total

14

Last Release

1547d ago

Major Versions

5.6.5 → 6.02019-10-14

6.0 → 7.02020-03-05

7.0 → 8.02020-09-22

8.0 → 9.02022-04-09

PHP version history (2 changes)5.5.0PHP &gt;=7.0.0

5.6.0PHP &gt;=7.1.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/81d04b4ae6ae4722e82dce4a1de424ca4c147c247cf2df0cb8ad2f9757d6126e?d=identicon)[kamalsroor](/maintainers/kamalsroor)

---

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)")[![kamalsroor1](https://avatars.githubusercontent.com/u/157611649?v=4)](https://github.com/kamalsroor1 "kamalsroor1 (3 commits)")[![newtongamajr](https://avatars.githubusercontent.com/u/8673343?v=4)](https://github.com/newtongamajr "newtongamajr (2 commits)")[![jasonlbeggs](https://avatars.githubusercontent.com/u/25065083?v=4)](https://github.com/jasonlbeggs "jasonlbeggs (2 commits)")[![LasseRafn](https://avatars.githubusercontent.com/u/2689341?v=4)](https://github.com/LasseRafn "LasseRafn (1 commits)")[![jualoppaz](https://avatars.githubusercontent.com/u/5088244?v=4)](https://github.com/jualoppaz "jualoppaz (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/kamalsroor-laravel-cross-database-subqueries/health.svg)

```
[![Health](https://phpackages.com/badges/kamalsroor-laravel-cross-database-subqueries/health.svg)](https://phpackages.com/packages/kamalsroor-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.2M194](/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)
