2 months ago

Dynamic foreign relationship

Posted 2 months ago by timtom


I have a problem, i would like to get data through variable content. Example :

$data = Model::find(1); $key = 'partner->name';

echo $data->$key;

But it is not working, someone already got this problem ?

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