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
Requires
- php: ^7.2
- illuminate/database: ~5.8.0|^6.0
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;
....
}