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 1mo ago

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

28

—

LowBetter than 54% of packages

Maintenance29

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

1161d 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

[cviebrock/eloquent-sluggable

Easy creation of slugs for your Eloquent models in Laravel

4.0k13.6M253](/packages/cviebrock-eloquent-sluggable)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[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)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)

PHPackages © 2026

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