mistery23/eloquent-object-relations

This package is abandoned and no longer maintained. No replacement package was suggested.

laravel object relations

v1.2.6 2019-12-25 22:45 UTC

This package is auto-updated.

Last update: 2020-10-26 01:05:53 UTC


README

Install

composer require mistery23/eloquent-object-relations

Using

If you use value object wrap in id primary key, or foreign key (your value object by id need to implement magic method __toSting()), or primary key is string.

Work with relations: BelongsTo, BelongsToMany, HasOne, HasMany.

use Mistery23\ObjectRelations\HasObjectRelations;

class User extends Model
{
    use HasObjectRelations;
    ....
}