Level 104
Use first() rather than get() if you want a Model instance rather than a Collection.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How can I convert a query where a collection of objects brings me and therefore if I want to access an attribute of that object I have to cycle through it, unlike a find that brings me a different structure and I can directly access an attribute without need of the cycle, If I know that my query will bring me just one row how can I convert the structure where to find to be able to access directly to its attributes?
Use first() rather than get() if you want a Model instance rather than a Collection.
Please or to participate in this conversation.