How to Use The whereNull() and whereNotNull() Methods - Mastering Eloquent & Collection Methods
In this tutorial, we will cover the whereNull() and whereNotNull() methods in Laravel Collections. These methods are used to filter a collection based on the values of a specific column that is null or not null, respectively. We will explain when and why these methods are useful, and demonstrate how to use them with both Eloquent models and simple collections. We will also show examples of how these methods can be used to efficiently filter through large collections of data. By the end of this tutorial, you will have a solid understanding of how to use these methods and when to apply them in your projects.
π New Udemy Course
If you're looking to level up your Laravel skills? My new course "Mastering Laravel 10 Query Builder, Eloquent & Relationships" is the perfect opportunity. Learn the essential tools and techniques for building robust and scalable web applications with Laravel: https://www.udemy.com/course/mastering-laravel-10-query-builder-eloquent-relationships/?referralCode=C784C3DB5B8925207FCB
π² Letβs plan a meeting
Plan a (paid) 1-hour meeting on Calendly to do portfolio reviews, code reviews resume reviews, or a coaching session for Laravel: https://calendly.com/codewithdary
π Newsletter
Sign up for my free weekly email newsletter: https://newsletter.codewithdary.com/
π₯ Resources
- Twitter: https://twitter.com/codewithdary
- Instagram: https://www.instagram.com/codewithdary
- Blog: https://blog.codewithdary.com
- Patreon: https://www.patreon.com/user?u=30307830
- GitHub: https://github.com/codewithdary
- TikTok: https://www.tiktok.com/@codewithdary
π Table of Content
00:00 - Introduction
00:26 - whereNull()
03:02 - whereNotNull()
04:20 - Outro
#laravel #php #codewithdary