PHPackages                             codemonkeyluffy/laravel-wherehasin - 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. codemonkeyluffy/laravel-wherehasin

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

codemonkeyluffy/laravel-wherehasin
==================================

Laravel ORM whereHasIn

1.0(5y ago)049MITPHPPHP &gt;=7.0

Since Jul 20Pushed 5y agoCompare

[ Source](https://github.com/CodeMonkeyLuffy/laravel-wherehasin)[ Packagist](https://packagist.org/packages/codemonkeyluffy/laravel-wherehasin)[ Docs](https://github.com/CodeMonkeyLuffy)[ RSS](/packages/codemonkeyluffy-laravel-wherehasin/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

Laravel whereHasIn
==================

[](#laravel-wherehasin)

`Laravel whereHasIn`是一个可以提升`Laravel ORM`关联关系查询性能的扩展包，可以替代`Laravel ORM`中的`whereHas`以及`whereHasMorphIn`查询方法。

环境
--

[](#环境)

- PHP &gt;= 7
- laravel &gt;= 5.5

安装
--

[](#安装)

```
composer require CodeMonkeyLuffy/laravel-wherehasin
```

### 简介

[](#简介)

`Laravel`的关联关系查询`whereHas`在日常开发中给我们带来了极大的便利，但是在主表数据量比较多的时候会有比较严重的性能问题，主要是因为`whereHas`用了`where exists (select * ...)`这种方式去查询关联数据。

License
-------

[](#license)

[The MIT License (MIT)](LICENSE).

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2174d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6491ad3441669fa4d26b8852f86c0bb5728153ddbf9ac896c8a288a717e474cb?d=identicon)[CodeMonkeyLuffy](/maintainers/CodeMonkeyLuffy)

---

Top Contributors

[![CodeMonkeyLuffy](https://avatars.githubusercontent.com/u/4016890?v=4)](https://github.com/CodeMonkeyLuffy "CodeMonkeyLuffy (1 commits)")

---

Tags

laravelormrelationwhereHas

### Embed Badge

![Health badge](/badges/codemonkeyluffy-laravel-wherehasin/health.svg)

```
[![Health](https://phpackages.com/badges/codemonkeyluffy-laravel-wherehasin/health.svg)](https://phpackages.com/packages/codemonkeyluffy-laravel-wherehasin)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.9M11.5k](/packages/illuminate-database)[biiiiiigmonster/hasin

Laravel framework relation has in implement

154588.1k](/packages/biiiiiigmonster-hasin)[dcat/laravel-wherehasin

Laravel ORM whereHasIn

247159.4k5](/packages/dcat-laravel-wherehasin)[matchory/elasticsearch

The missing elasticsearch ORM for Laravel!

3064.0k](/packages/matchory-elasticsearch)[flightphp/active-record

Micro Active Record library in PHP, support chain calls, events, and relations.

164.0k11](/packages/flightphp-active-record)

PHPackages © 2026

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