Bird
0
0

Given this route registration:

medium📝 component behavior Q4 of 15
Laravel - Controllers
Given this route registration:
Route::resource('products', ProductController::class);
Which URL and HTTP method calls the update method?
ADELETE /products/{product}
BPUT /products/{product}
CPOST /products
DGET /products/{product}/edit
Step-by-Step Solution
Solution:
  1. Step 1: Recall HTTP method for update in resource controllers

    Update uses PUT or PATCH method with resource ID.
  2. Step 2: Match URL pattern for update

    URL is /products/{product} with PUT method.
  3. Final Answer:

    PUT /products/{product} -> Option B
  4. Quick Check:

    Update method URL and HTTP verb [OK]
Quick Trick: Update uses PUT or PATCH with resource ID URL [OK]
Common Mistakes:
  • Confusing update with edit URL
  • Using POST instead of PUT
  • Mixing delete method with update

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes