1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 21:34:03 +00:00
laravel-tips/content/tips/you-can-use-request-whenfilled-to-execute-some-logic-only-when-a-specific-value-is-part-of-the-request-data.md
2021-12-10 16:25:33 +01:00

17 lines
719 B
Markdown

---
title: 'You can use $request->whenFilled() to execute some logic only when a specific value is part of the request data'
tweet_id: '1469321066182955010'
thread_slug: weekly-thread-2021-49
author_username: mmartin_joo
images:
- 'https://pbs.twimg.com/media/FF38VhkXsAAv0VW.png'
created_at: 2021-12-10T15:00:15+00:00
slug: you-can-use-request-whenfilled-to-execute-some-logic-only-when-a-specific-value-is-part-of-the-request-data
---
🔥Another amazing #Laravel feature!🔥
We often write if statements to check if a value is present on a request or not.
You can simplify it with the whenFilled() helper.
👋If you find this useful, consider clicking the button that says Retweet. It's a very cool button!