Testing for relation between Eloquent objects (Laravel 4) -
in laravel 4, there method allows test relationship between 2 eloquent objects without knowing type of relationship beforehand?
for example, user model have 1:1 relation profile , 1:m relation comments. i'm looking way along lines of following:
if ($user->isrelatedto($someotherobject)) { // stuff }
unfortunately there not, relations not managed in config files impossible test. make these config files , extend eloquent implement method.
Comments
Post a Comment