This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

christian15093
christian15093

I have a field called client in Model Project $belongsTo array and it pulls the list from Client. I only want to display certain clients in the list and not all clients It seems that I can override the data passed in by creating a public function client() in the model, but what kind of data needs to be returned? Is this even the right way for the solution?

Thanks, -Christian

alxy
alxy

Relation definitions can contain scopes or conditions: http://octobercms.com/docs/database/relations#detailed-relationships

Last updated

christian15093
christian15093

Thanks alxy! Totally missed the fact that you can add conditions there.

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.