filmov
tv
How to Use The Powerful reject() Method in Laravel - Mastering Eloquent & Collection Methods
Показать описание
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
🧑🏼💻 Let’s plan a meeting
💌 Newsletter
🔥 Resources
📋 Table of Content
00:00 - Simple Example
02:05 - Advanced Example
03:14 - reject() vs whereNotNull()
04:12 - Outro
#laravel #php #codewithdary
📚 New Udemy Course
🧑🏼💻 Let’s plan a meeting
💌 Newsletter
🔥 Resources
📋 Table of Content
00:00 - Simple Example
02:05 - Advanced Example
03:14 - reject() vs whereNotNull()
04:12 - Outro
#laravel #php #codewithdary