Bird
0
0

Find the problem in this Laravel controller method:

medium📝 Debug Q7 of 15
Laravel - Basics and Architecture
Find the problem in this Laravel controller method:
public function show() { return view('profile'); }
AMissing return type declaration
BView name should be capitalized
CMethod lacks a route to call it
DFunction must be static
Step-by-Step Solution
Solution:
  1. Step 1: Understand controller usage

    Controller methods need routes to be accessible via URLs.
  2. Step 2: Identify missing part

    Without a route pointing to this method, it won't be called.
  3. Final Answer:

    Method lacks a route to call it -> Option C
  4. Quick Check:

    Controller methods need routes [OK]
Quick Trick: Connect controller methods with routes [OK]
Common Mistakes:
  • Expecting automatic calls without routes
  • Thinking return type is mandatory
  • Assuming view names must be capitalized

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes