Looking to hire Laravel developers? Try LaraJobs

laravel-belongs-to-user maintained by umutphp

Description
The smallest Laravel package for having User belongs to relation
Author
Last update
2023/11/20 13:54 (dev-master)
License
Downloads
864

Comments
comments powered by Disqus

Laravel Belongs To User Package

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.