1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 13:24:03 +00:00
laravel-tips/content/tips/higher-order-messages-are-a-great-way-to-tidy-up-long-collection-logic.md
lukinovec e907eba3dd
Weekly thread #4 (#26)
* Use Author::updateOrCreate instead of firstOrCreate

* Weekly tips #4
2022-01-28 18:03:12 +01:00

546 B

title tweet_id thread_slug author_username images created_at slug
Higher-order messages are a great way to tidy up long collection logic 1487081947864002572 weekly-thread-2022-04 alexjgarrett
https://pbs.twimg.com/media/FKD7ajmXIAAEjTW.jpg
2022-01-28T15:15:39+00:00 higher-order-messages-are-a-great-way-to-tidy-up-long-collection-logic

Sometimes I forget about higher order collection messages in Laravel, but they're a great way to shorten and tidy up your code

Here's a simplified (and not recommended) example.