Laravel Collection Filtering: Tips and Tricks #shorts

Laravel Collection Filtering: Tips and Tricks #shorts

Code With Dary

1 год назад

16,215 Просмотров

This YouTube short will show you how you could use Laravel its filter method on your collections to write your own logic. The filter method filters a collection using the given callback, keeping only those items that pass a given truth test.

📲  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

#youtube #shorts

Тэги:

#laravel #learn_laravel_for_beginners #laravel_full_course #laravel_tutorial_youtube #how_to_learn_laravel #complete_laravel_9_course #learn_laravel_9 #complete_laravel #laravel_from_scratch #laravel_code #learn_laravel_code #Complete_Laravel_Tutorial #laravel_tutorial #laravel_9_for_beginners #laravel9 #collection_vs_array_laravel #what_are_collections_array #what_are_collections #what_is_collection_in_laravel #filtering_for_beginners_laravel #filter_data_laravel
Ссылки и html тэги не поддерживаются


Комментарии:

Kiss Tamás
Kiss Tamás - 01.07.2023 01:16

what if you have millions and millions users? its better to filter with the query like from an array.

Ответить
Alessandro Amos
Alessandro Amos - 17.03.2023 23:27

The filter method of the Collection is useful for filtering the data of a collection. However, in this example, it would be more efficient to filter the users directly in the query :)

Ответить
KIMELI RONALD
KIMELI RONALD - 05.03.2023 17:53

This is a sharpening 🔥 tool

Ответить
Viktoras Buivydas
Viktoras Buivydas - 24.02.2023 22:33

You should avoid getting all records from the database. It would be better to use where and filter data this way.

Ответить
nachzzz from hell
nachzzz from hell - 23.02.2023 06:48

is not better use a getter on the model and return if the user is admin?

Ответить
السكر
السكر - 17.01.2023 22:39

$&£/$÷^٣&$@&)تبك😐

Ответить