Is there a way to (automatically) list all relations of a model?

Posted 3 years ago by davestewart

Something like $model->listRelated()?

I assume not as relations are encapsulated inside methods.

My second assumption is that this means I simply need to create a mechanism to get this information elsewhere, perhaps a model property, method, or other metadata?

Another thought - might there be any DB::methods() that would cover this? If not, metadata is a fine solution.

EDIT: I changed the original title from "get" to "list" to make my intention clearer

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.