Laravel - ControllersWhy does Laravel's apiResource exclude 'create' and 'edit' routes compared to resource routes?ABecause apiResource only supports GET and POST methodsBBecause 'create' and 'edit' methods are deprecated in LaravelCBecause 'create' and 'edit' are handled by middleware automaticallyDBecause 'create' and 'edit' are for returning HTML views, not API JSON responsesCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand difference between resource and apiResourceresource routes include 'create' and 'edit' for web pages (HTML views).Step 2: Reason why apiResource excludes themapiResource is for APIs that return JSON, so it excludes routes that serve HTML forms.Final Answer:Because 'create' and 'edit' are for returning HTML views, not API JSON responses -> Option DQuick Check:apiResource excludes HTML view routes [OK]Quick Trick: apiResource excludes HTML form routes for API purity [OK]Common Mistakes:Thinking methods are deprecatedBelieving apiResource limits HTTP verbsAssuming middleware handles these routes
Master "Controllers" in Laravel9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallPerf
More Laravel Quizzes Controllers - Resource controllers - Quiz 6medium Controllers - Why controllers organize request handling - Quiz 14medium Database Basics and Migrations - Tinker for database interaction - Quiz 10hard Database Basics and Migrations - Why database integration is core - Quiz 14medium Laravel Basics and Architecture - Artisan CLI overview - Quiz 15hard Request and Response - File uploads - Quiz 8hard Routing - Optional parameters - Quiz 5medium Routing - Route prefixes - Quiz 12easy Routing - Route groups - Quiz 12easy Views and Blade Templates - Components and slots - Quiz 12easy