MEGApixel23 / belongs-to-one

BelongsToOne relation for Laravel 5
8 stars 2 forks source link

Doesn't work with lazy load #5

Open jeshtan opened 6 years ago

jeshtan commented 6 years ago

As subject, BelongsToOne relation does return desired object instead of collection if we eager load, however it doesn't work with lazy loading. Any idea?

$record = Record->first(); dump($record->group); // return model collection instead of Group object

ankurk91 commented 5 years ago

you may want to use this package

https://github.com/ankurk91/laravel-eloquent-relationships