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

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

lightman/laravel-cross-database-subqueries
==========================================

Eloquent cross database compatibility in subqueries

12(1y ago)1708HTMLPHP &gt;=7.1.3

Since Oct 12Pushed 1y agoCompare

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

READMEChangelog (2)Dependencies (7)Versions (3)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

27

—

LowBetter than 49% of packages

Maintenance41

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

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

Total

2

Last Release

495d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4ec4db3c6b0b2a0a7b6bf6902b618b7ab40c2b74f6eabfb01da0585c1f70fad1?d=identicon)[LightMan01](/maintainers/LightMan01)

---

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)")[![LightMan01](https://avatars.githubusercontent.com/u/39643591?v=4)](https://github.com/LightMan01 "LightMan01 (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)")[![buglinjo](https://avatars.githubusercontent.com/u/1254208?v=4)](https://github.com/buglinjo "buglinjo (1 commits)")[![jualoppaz](https://avatars.githubusercontent.com/u/5088244?v=4)](https://github.com/jualoppaz "jualoppaz (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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