Bird
0
0

Examine this Laravel validation snippet:

medium📝 Debug Q7 of 15
Laravel - Request and Response
Examine this Laravel validation snippet:
$request->validate([
    'password' => 'required|min:8|confirmed'
]);

What is the purpose of the confirmed rule here?
AIt checks that the password is unique in the database.
BIt requires the password to contain at least one special character.
CIt validates that the password is encrypted.
DIt ensures there is a matching <code>password_confirmation</code> field with the same value.
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'confirmed' rule

    The 'confirmed' rule requires a matching field named password_confirmation with the same value.
  2. Step 2: Check other options

    It does not enforce special characters, encryption, or uniqueness.
  3. Final Answer:

    It ensures there is a matching password_confirmation field with the same value. -> Option D
  4. Quick Check:

    'confirmed' checks matching confirmation field [OK]
Quick Trick: Confirmed means matching _confirmation field [OK]
Common Mistakes:
  • Thinking it enforces special characters
  • Assuming it validates encryption
  • Believing it checks database uniqueness

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes