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

virgo9793756674
virgo9793756674

I have 3 models User Client quotes.

I have a Client to User relationship from which I get the name. I have a relation from quotes to Client, but from here I can't get the name field because client only gets user_id.

My question is if I can get the parameter name from the initial model (User) to the final model (quotes) if the relationship is from quotes to client

mjauvin
mjauvin

yes, but please show your relation definitions with as much details as possible so I can help

virgo9793756674
virgo9793756674

Models: 1.-User (Plugin the User) -id -yam -etc

2.-Client. -id -user_id -description -etc

3.-Quotes. -id -client_id -title

In my Client Fields.yaml I have a relationship type field where in Name Column I display the User name field.

In my Quotes Fields.yaml I have a relationship type field to Client but here I want to bring the name of that client but since in the client table I do not have the name field, I need to bring it from user.

Last updated

mjauvin
mjauvin

Please show the actual relation definition in your models. (i.e. $belongsToMany[], etc...)

virgo9793756674
virgo9793756674

public $hasManyThrough = [ 'client' => [ 'Rainlab\User\Models\User', 'through' => 'Zonek\Clientes\Models\Client' ], ];

mjauvin
mjauvin

Would it be so hard to at least mention in which model the above is ? I can't help with this few details, sorry.

1-6 of 6

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