Read up on Eloquent here. Eloquent follows certain naming conventions you should follow.
Also, read up on Eloquent relations. This way you can access related tables with some good old' "Magic".
To answer your question: user first() instead of get(). The get() function will retrieve a collection, while the first() method will retrieve a single record.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community