PHPackages                             nhalstead/transferable - 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. nhalstead/transferable

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

nhalstead/transferable
======================

Transfer attached relationships from one model instance to another model instance of the same type.

1.0.3(4y ago)0199MITPHPPHP ^7.3|^8.0CI passing

Since Oct 13Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/nhalstead/transferable)[ Packagist](https://packagist.org/packages/nhalstead/transferable)[ Docs](https://github.com/nhalstead/transferable)[ RSS](/packages/nhalstead-transferable/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (4)Dependencies (4)Versions (6)Used By (0)

Laravel Transferable Model Relationships
========================================

[](#laravel-transferable-model-relationships)

Make laravel model relationships transferable!

This is perfect to use when you want a model relationships to me assigned to another model (of the same type) and not be deleted or set null.

Install
-------

[](#install)

```
composer require nhalstead/transferable
```

How to use
----------

[](#how-to-use)

On the model its self you need to add in the use statement and optionally add in the implements to block the model from being deleted.

```

```

What makes it efficient? This will use the model's relationship to determine what needs to be updated in the database and runs a query on the DB to update the relationships without any extra calls to get all the IDs and detaching things.

### What else?

[](#what-else)

Nothing else, This package offers a few extra method for debugging and collecting information on the transferable relationships, see below:

```
// Return the number of transferable items attached to this model
$newUser->countTransferable();

// Return boolean if it would have any dangling relationships if deleted.
// The false param tells it not to throw an Exception
$newUser->hasDangling();

// Throw an exception when there are records dangling
$newUser->throwIfDangling();
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance53

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Every ~172 days

Total

4

Last Release

1573d ago

PHP version history (2 changes)1.0.0PHP ^7.3

1.0.2PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9c3c2c0bc46e9d988cd3b9af2c7a3dca6906092c5029017a802477343230f69?d=identicon)[nhalstead00](/maintainers/nhalstead00)

---

Top Contributors

[![nhalstead](https://avatars.githubusercontent.com/u/5577816?v=4)](https://github.com/nhalstead "nhalstead (27 commits)")

---

Tags

laravel-eloquentphp-laraveltransferable-relationshipslaraveleloquenttranserable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nhalstead-transferable/health.svg)

```
[![Health](https://phpackages.com/badges/nhalstead-transferable/health.svg)](https://phpackages.com/packages/nhalstead-transferable)
```

###  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)[spatie/laravel-sluggable

Generate slugs when saving Eloquent models

1.6k12.9M309](/packages/spatie-laravel-sluggable)[watson/validating

Eloquent model validating trait.

9803.5M54](/packages/watson-validating)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[cybercog/laravel-love

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

1.2k332.0k1](/packages/cybercog-laravel-love)

PHPackages © 2026

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