PHPackages                             umutphp/laravel-belongs-to-user - 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. umutphp/laravel-belongs-to-user

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

umutphp/laravel-belongs-to-user
===============================

The smallest Laravel package for having User belongs to relation

1.0.5(4y ago)4864MITPHPPHP ^8.0

Since Feb 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/umutphp/laravel-belongs-to-user)[ Packagist](https://packagist.org/packages/umutphp/laravel-belongs-to-user)[ Docs](https://github.com/umutphp/laravel-belongs-to-user)[ GitHub Sponsors](https://github.com/umutphp)[ RSS](/packages/umutphp-laravel-belongs-to-user/feed)WikiDiscussions master Synced 2d ago

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

Laravel Belongs To User Package
===============================

[](#laravel-belongs-to-user-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8fd223fceab4ecdc82cbe60a3e914b50edc971693b19f21282f0a2b623280507/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f756d75747068702f6c61726176656c2d62656c6f6e67732d746f2d757365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/umutphp/laravel-belongs-to-user)[![Total Downloads](https://camo.githubusercontent.com/a79aa4736659259d584ea781aa67bfa3e5a9980aecd2ba60613b76b2dbb59ec9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f756d75747068702f6c61726176656c2d62656c6f6e67732d746f2d757365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/umutphp/laravel-belongs-to-user)

---

If you are creating your own trait to have "belongsTo" User relationship in every model needed, you can also use this package not to define the trait on your own.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require umutphp/laravel-belongs-to-user

php artisan vendor:publish --provider="UmutPHP\BelongsToUser\BelongsToUserServiceProvider"
```

Usage
-----

[](#usage)

```
...

use Illuminate\Database\Eloquent\Model;
use UmutPHP\BelongsToUser\BelongsToUser;

class UserData extends Model
{
    use BelongsToUser;

    ...
}
```

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Umut Işık](https://github.com/umutphp)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.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

Every ~17 days

Total

6

Last Release

1500d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3245166?v=4)[Umut Işık](/maintainers/umutphp)[@umutphp](https://github.com/umutphp)

---

Top Contributors

[![umutphp](https://avatars.githubusercontent.com/u/3245166?v=4)](https://github.com/umutphp "umutphp (34 commits)")[![deepsource-io[bot]](https://avatars.githubusercontent.com/in/16372?v=4)](https://github.com/deepsource-io[bot] "deepsource-io[bot] (1 commits)")

---

Tags

eloquent-modelshacktoberfestlaravellaravel-packagelaravelmodeleloquentumutphpbelongs-to-user

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/umutphp-laravel-belongs-to-user/health.svg)

```
[![Health](https://phpackages.com/badges/umutphp-laravel-belongs-to-user/health.svg)](https://phpackages.com/packages/umutphp-laravel-belongs-to-user)
```

###  Alternatives

[spatie/eloquent-sortable

Sortable behaviour for eloquent models

1.5k25.7M319](/packages/spatie-eloquent-sortable)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4843.1M9](/packages/dyrynda-laravel-model-uuid)[lacodix/laravel-model-filter

A Laravel package to filter, search and sort models with ease while fetching from database.

17558.6k](/packages/lacodix-laravel-model-filter)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

213421.2k2](/packages/wnx-laravel-backup-restore)[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

16354.2k](/packages/relaticle-custom-fields)[elipzis/laravel-cacheable-model

Automatic query-based model cache for your Laravel app

15853.1k](/packages/elipzis-laravel-cacheable-model)

PHPackages © 2026

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