In this tutorial, we will explore how to use a model scope with a relationship condition to filter and retrieve posts based on their comment count.
Category: Database
In this tutorial, you'll learn to add a model scope with parameters to filter and retrieve data. This allows you to create even more flexible query constraints.
In this guide, we'll explore how to create and use model scopes in Laravel Eloquent, using a practical example of filtering published and draft posts.
In this tutorial, you'll learn how to add a soft delete feature to your Models. We'll cover how to soft delete, restore, or permanently delete records.
This tutorial teaches how to define the models, relationships, and factories to create data for a model and its relationships.
How to Add a Where Clause to a Relationship Query in Laravel
In this article, we'll explore techniques to add a where clause to Eloquent relationships. I'll explain using methods as with(), withCount() and doesntHave()