Category: Laravel

Laravel Eloquent ORM provides a whole lot of useful functionality which allows you to work with your database tables and relationships using an eloquent expressive syntax. So, In here are some of the features which you might often reach out for ease of use and cleaner code in your laravel project.

Or, you can even find multiple records at once by passing array of ids as second argument.

you can retrieve the number of results from a relationship without actually loading them you may use the withCount method. Define a relation comments(): Then, you can use like this: You can continue with this post onhttps://laravelproject.com/10-laravel-7-eloquent-tricks/
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners