How to Use The Powerful reject() Method in Laravel - Mastering Eloquent & Collection Methods

Subscribers:
64,200
Published on ● Video Link: https://www.youtube.com/watch?v=nAYxXjmRI0g



Category:
Tutorial
Duration: 4:38
568 views
25


In this tutorial, we’re going to cover the reject() method in Laravel, which is a very useful tool for filtering through collections. This method is the inverse of the filter() method, as it removes any elements that do not pass a given truth test, returning a new filtered collection. Dary demonstrates how to use the reject() method with a simple variable, a callback function, and with Laravel's Article model. He also highlights the power of the reject() method, as it allows you to pass in a custom callback function to determine the truth test for each element in the collection.

📚 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 - Simple Example
02:05 - Advanced Example
03:14 - reject() vs whereNotNull()
04:12 - Outro

#laravel #php #codewithdary




Other Videos By Code With Dary


2023-05-15How to Map Collections Using The mapWithKeys() Method - Mastering Eloquent & Collection Methods
2023-05-15Laravel Pro Tip: Easily Redirect to Controller Actions in Laravel #laravel #shorts
2023-05-11How to Easily Retrieve The Average Value of a Related Record in Laravel #laravel #shorts
2023-05-09How to Easily Retrieve The Sum of Related Records in Laravel #laravel #shorts
2023-05-09How to Easily Retrieve The Minimum Value of a Related Record in Laravel #laravel #shorts
2023-05-08How to Easily Retrieve The Maximum Value of a Related Record in Laravel #laravel #shorts
2023-05-08How to Use The Powerful() map() Method in Laravel - Mastering Eloquent & Collection Methods
2023-05-05How to Use The contains(), except() & only() Methods - Mastering Eloquent & Collection Methods
2023-05-05How to Easily Remember User Credentials In Laravel Cookies #laravel #shorts
2023-05-04How to EASILY Convert Singular Nouns to Plural in Laravel #laravel #shorts
2023-05-03How to Use The Powerful reject() Method in Laravel - Mastering Eloquent & Collection Methods
2023-05-02How to EASILY Convert Strings to Title Case in Laravel #laravel #shorts
2023-05-01Laravel Magic: Converting Plural Words to Singular with Just One Method #laravel #shorts
2023-05-01How to Use The Powerful filter() Method in Laravel - Mastering Eloquent & Collection Methods
2023-04-28How to Mask Sensitive Data in Your Laravel Application #laravel #shorts
2023-04-28The Hidden Laravel Methods to Filter Based on Date & Time - Mastering Eloquent & Collection Methods
2023-04-27Truncating a String Based on Words in Laravel?! #laravel #shorts
2023-04-26How to Use The whereNull() and whereNotNull() Methods - Mastering Eloquent & Collection Methods
2023-04-26The EASIEST Method to Convert a String to Camel Case in Laravel #laravel #shorts
2023-04-25The EASIEST Method to Convert a String to Camel Case in Laravel #laravel #shorts
2023-04-24How to Use The whereIn() and whereNotIn() Laravel Methods - Mastering Eloquent & Collection Methods



Tags:
introduction to collections
introduction to laravel collections
learn collections in laravel
introduction to laravel 10
learn laravel collections step by step
learn laravel for beginners
collection methods in laravel
what is eloquent in laravel
learn laravel 10
laravel 10 from scratch
laravel 10 for beginners
laravel 10 tutorial youtube
how to use collection methods in laravel
laravel 10 tutorial 2023
complete laravel 10
complete laravel 10 database