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

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

vhunakoshi/laravel-cross-database-subqueries
============================================

Eloquent cross database compatibility in subqueries

011HTML

Since Oct 15Pushed 8mo agoCompare

[ Source](https://github.com/vhunakoshi/laravel-cross-database-subqueries)[ Packagist](https://packagist.org/packages/vhunakoshi/laravel-cross-database-subqueries)[ RSS](/packages/vhunakoshi-laravel-cross-database-subqueries/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/e774e057e577c6e0629661058d2c7f9e8266fe42300fa75942386337bfba736f/68747470733a2f2f7472617669732d63692e6f72672f5668756e616b6f7368692f6c61726176656c2d63726f73732d64617461626173652d737562717565726965732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Vhunakoshi/laravel-cross-database-subqueries) [![Codacy Badge](https://camo.githubusercontent.com/e92d1dac0ace161f1b199b6f923e1b006c9685120788ffb98e9ed61ce773b087/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3565663135326564663133643434343061396363616366393432626265636639)](https://www.codacy.com/app/mario-Vhunakoshi/laravel-cross-database-subqueries?utm_source=github.com&utm_medium=referral&utm_content=Vhunakoshi/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 securityWhy 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 Vhunakoshi/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

```
Vhunakoshi\CrossDatabase\CrossDatabaseServiceProvider::class,

```

Usage
=====

[](#usage)

In your `Models` extends from:

- Vhunakoshi\\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.# laravel-cross-database-subqueries

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance42

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/61453320?v=4)[vhunakoshi](/maintainers/vhunakoshi)[@vhunakoshi](https://github.com/vhunakoshi)

### Embed Badge

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

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198741.5k12](/packages/pgvector-pgvector)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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