PHPackages                             panakour/laravel-eloquent-relationships - 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. panakour/laravel-eloquent-relationships

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

panakour/laravel-eloquent-relationships
=======================================

programmatically get the laravel eloquent relationships.

v0.0.1(3y ago)012.1kMITPHPPHP ^8.1

Since Mar 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/panakour/laravel-eloquent-relationships)[ Packagist](https://packagist.org/packages/panakour/laravel-eloquent-relationships)[ RSS](/packages/panakour-laravel-eloquent-relationships/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Get laravel eloquent relations using reflection.
------------------------------------------------

[](#get-laravel-eloquent-relations-using-reflection)

[![tests](https://github.com/panakour/laravel-eloquent-relationships/actions/workflows/tests.yml/badge.svg)](https://github.com/panakour/laravel-eloquent-relationships/actions/workflows/tests.yml)[![Code Coverage Badge](./coverage-badge.svg)](./coverage-badge.svg)[![Total Downloads](https://camo.githubusercontent.com/cf3cf5286a3ec8b2d09b5f5671d05f3adf6790b0a76821a09bbf9fbc572df854/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70616e616b6f75722f6c61726176656c2d656c6f7175656e742d72656c6174696f6e73686970732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/panakour/laravel-eloquent-relationships)

### This will let you programmatically get the relations of models in laravel to use them how you want.

[](#this-will-let-you-programmatically-get-the-relations-of-models-in-laravel-to-use-them-how-you-want)

Examples
--------

[](#examples)

```
use EloquentRelationships\RelationMethods;
use EloquentRelationships\Relations;

$relations = new Relations(new YourModel());

//get all relations
$collection = $relations->all();

//or get relations by method

//belongsToMany
$collection = $relations->getByMethod(RelationMethods::BelongsToMany->value);

//MorphedByMany
$collection = $relations->getByMethod(RelationMethods::MorphedByMany->value);
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

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

1213d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6680ff78b32fb6b99cd57ea2fdc49b5d5e449c0f9991aae0a15285ccf17fc1f4?d=identicon)[panakour](/maintainers/panakour)

---

Top Contributors

[![panakour](https://avatars.githubusercontent.com/u/12927166?v=4)](https://github.com/panakour "panakour (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")

---

Tags

laravelreflectioneloquentRelationships

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/panakour-laravel-eloquent-relationships/health.svg)

```
[![Health](https://phpackages.com/badges/panakour-laravel-eloquent-relationships/health.svg)](https://phpackages.com/packages/panakour-laravel-eloquent-relationships)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[psalm/plugin-laravel

Psalm plugin for Laravel

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

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.3M18](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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