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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners