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

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -