Bird
0
0

In Laravel, what does a controller method typically return?

easy📝 Conceptual Q1 of 15
Laravel - Controllers
In Laravel, what does a controller method typically return?
AAn HTML file path as a string
BOnly a string message
CA response such as a view, JSON, or redirect
DA database query result directly
Step-by-Step Solution
Solution:
  1. Step 1: Understand controller method role

    Controller methods handle requests and return responses like views or JSON.
  2. Step 2: Identify typical return types

    They do not return raw strings or file paths but structured responses.
  3. Final Answer:

    A response such as a view, JSON, or redirect -> Option C
  4. Quick Check:

    Controller method return [OK]
Quick Trick: Controller methods return responses, not raw data [OK]
Common Mistakes:
  • Thinking controller returns raw strings only
  • Confusing controller return with model data
  • Assuming controller returns file paths

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes