I checked the documentation, but can't seem to find what I'm looking for. I have two tables:
Pages Layouts
With a table between (pages__layouts) that does the many-to-many. This is working great. However, when referencing the relationship, I always want:
$p->layout[1]
To be the most recent layout that also has a status of 1. Is there a conditional many-to-many in the model or do I do this in the Controller when I reference the layout for the first time?
I have just been using lazy loading to get the layouts when I need them.
Thanks