Unit5 - Subjective Questions

INT221 • Practice Questions with Detailed Answers

1

Explain the concept of CSRF protection in Laravel and how to implement it in a form.

2

What is Method Spoofing in Laravel forms, and why is it necessary for RESTful resource controllers?

3

Describe the standard process of validating form data in a Laravel Controller using the validate method.

4

List and explain five common Validation Rules available in Laravel.

5

How can you display validation error messages in a Blade view file?

6

Explain the concept of Repopulating Forms using the old() helper function.

7

How do you create and use a Custom Validation Rule object in Laravel?

8

Differentiate between using Form Request Validation and Controller Validation.

9

What is the confirmed validation rule, and how does it relate to form field naming conventions?

10

How can you customize Validation Error Messages for specific fields?

11

Explain the concept of Stopping on First Failure using the bail rule.

12

How do you handle validation for Nested Attributes (arrays) in Laravel?

13

Describe how to perform validation using Closures instead of creating a Rule object.

14

Explain the unique validation rule with respect to ignoring a specific ID during updates.

15

How does Laravel handle Optional Fields that must be validated only if present?

16

Discuss how to repopulate checkboxes and select menus using the old() helper.

17

What are the requirements for validating a file upload (e.g., an image) in Laravel?

18

Explain the role of the $errors variable and the Illuminate\Support\MessageBag instance in Laravel views.

19

How does Laravel localize validation error messages?

20

Write a short note on the date and date_format validation rules.