Hi, I ran in to a little issue, I am trying to get the relation nodes of my product, however, it has to be an relation, and can not be a collection:
* Gets the nodes associated with a product.
*/
public function nodes(): HasMany
{
$node_ids = explode(',', $this->node_ids);
return $this->hasMany(Node::class, 'id', 'node_ids')->whereIn('id', $node_ids);
}```
I know with `Node::whereIn('id', $node_ids)->all()` it would've been done, but like I said, I need it to be a relation. Which is why I tried this above ^^, which I thought would work, but sadly, it only returns me the first node, not the second, third or any more.
`node_ids` is currently a imploded string with node id's `1,2,3,4`
Anyone an idea how I can do this?