3 Similar Columns (Slug or ID)
I need 3 similar columns on one table. I'm using nested set, but it really just two relationships on the same model.
In the above example the first two instances of
slug
work, but the 3rd doesn't. If I change those to pull the id
via relationship it doesn't work either. How can I overcome this? What's going on here in the background?1 Reply
The picture above shows the id for root_parent simply cause I called
root_parent_id
off the row after discovering root.slug
wouldn't work.
I solved this by changing the HasOne to BelongsTo on the Series Model.