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/you-can-validate-a-field-and-exclude-it-from-the-validated-data.md
Samuel Štancl 23979938b4 Week 17/2022
2022-04-29 21:07:03 +02:00

11 lines
No EOL
569 B
Markdown

---
title: 'You can validate a field and exclude it from the validated() data'
tweet_id: '1520040281818550274'
thread_slug: weekly-thread-2022-17
author_username: mattkingshott
images:
- 'https://pbs.twimg.com/media/FRLzG4QXEAAOfyA.jpg'
created_at: 2022-04-29T14:00:18+00:00
slug: you-can-validate-a-field-and-exclude-it-from-the-validated-data
---
🔥 #Laravel Tip: When you need to validate a field, but don't actually require it for anything e.g. 'accept terms and conditions', make use of the 'exclude' rule. That way, the 'validated' method won't return it...