PHPackages                             coder-packages/anonymous-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. coder-packages/anonymous-relationships

ActiveLibrary

coder-packages/anonymous-relationships
======================================

Laravel anonymous relationships in eloquent

04PHP

Since Dec 30Pushed 7y agoCompare

[ Source](https://github.com/coder-packages/laravel-anonymous-relationships)[ Packagist](https://packagist.org/packages/coder-packages/anonymous-relationships)[ RSS](/packages/coder-packages-anonymous-relationships/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel anonymous relationships in eloquent
===========================================

[](#laravel-anonymous-relationships-in-eloquent)

**Install package**

```
composer require larapackages/anonymous-relationships

```

**Add trait in the model**

```
use Larapackages\AnonymousRelationships\Traits\GeneratesIdentifier;

class User
{
	use GeneratesIdentifier;
}

```

**Add method to your model**

```
public function getIdentifierAttribute()
{
    return $this->generateIdentifier($this->id);
}

```

**Add relationship like this**

```
// has many relation
public function addresses()
{
    return $this->hasMany(Address::class, 'user_id', 'identifier');
}

// has one relation
public function address()
{
    return $this->hasOne(Address::class, 'user_id', 'identifier');
}

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/91a8cdf5092dcedfe7780fc81f4502cc79b514c1c958892cef47a395de43707b?d=identicon)[coder-packages](/maintainers/coder-packages)

---

Top Contributors

[![alikmanukian](https://avatars.githubusercontent.com/u/4147821?v=4)](https://github.com/alikmanukian "alikmanukian (6 commits)")

### Embed Badge

![Health badge](/badges/coder-packages-anonymous-relationships/health.svg)

```
[![Health](https://phpackages.com/badges/coder-packages-anonymous-relationships/health.svg)](https://phpackages.com/packages/coder-packages-anonymous-relationships)
```

PHPackages © 2026

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