Get all model relationships

Hi,

Is there anyway to get all the relationship of a model. I know there is a thread here

Stackoverflow thread

But this is somehow null in every case.

Any direction here will be very helpful.

Thanks alot.

The Rain model has a getRelationDefinitions() method that does exactly that.

foreach ($model->getRelationDefinitions() as $type => $relations) {
    foreach ($relations as $relation => $config) {
        $model->load($relation);
    }
}
2 Likes

@marco.grueter thanks alot. this is all i was looking for.