Skip to content

umutphp/laravel-belongs-to-user

Repository files navigation

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.