umutphp/laravel-belongs-to-user

The smallest Laravel package for having User belongs to relation

Maintainers

Package info

github.com/umutphp/laravel-belongs-to-user

pkg:composer/umutphp/laravel-belongs-to-user

Fund package maintenance!

umutphp

Statistics

Installs: 863

Dependents: 0

Suggesters: 0

Stars: 4

Open Issues: 0

1.0.5 2022-05-27 00:12 UTC

This package is auto-updated.

Last update: 2026-02-20 21:48:52 UTC


README

Latest Version on Packagist Total Downloads

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

You can install the package via composer:

composer require umutphp/laravel-belongs-to-user

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

Usage

...

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

class UserData extends Model
{
    use BelongsToUser;

    ...
}

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.