Eloquent Query Live-Coding Example: Get Latest Viewed Posts

Real-life example of Eloquent query that may be written more efficiently. So we’re getting from bad example to good one. What we’ll cover: - How to perform query in raw SQL - How to re-write it to Eloquent - How to transform the result collection to return exactly the structure we need If you want more practical examples like this (or a separate course, maybe?), let me know in the comments. - - - - - Our daily Laravel blog: Our 50 Laravel tips in a FREE e-book:
Back to Top