umutphp/laravel-belongs-to-user

The smallest Laravel package for having User belongs to relation

1.0.5 2022-05-27 00:12 UTC

This package is auto-updated.

Last update: 2024-10-20 18:55:44 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.