umutphp / laravel-belongs-to-user
The smallest Laravel package for having User belongs to relation
Fund package maintenance!
umutphp
Requires
- php: ^8.0
- spatie/laravel-package-tools: ^1.4.3
Requires (Dev)
- brianium/paratest: ^6.2
- nunomaduro/collision: ^5.3
- orchestra/testbench: ^6.15
- phpunit/phpunit: ^9.3
- spatie/laravel-ray: ^1.9
- vimeo/psalm: ^4.4
README
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.