Bird
0
0

You want to create a new controller named ProductController using Artisan. Which command should you run?

hard📝 Application Q15 of 15
Laravel - Basics and Architecture
You want to create a new controller named ProductController using Artisan. Which command should you run?
Aphp artisan new:controller ProductController
Bphp artisan create:controller ProductController
Cphp artisan make:controller ProductController
Dphp artisan generate controller ProductController
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct Artisan command for creating controllers

    The correct command uses the 'make:controller' syntax followed by the controller name.
  2. Step 2: Compare options

    Options B, C, and D use incorrect command formats not recognized by Artisan.
  3. Final Answer:

    php artisan make:controller ProductController -> Option C
  4. Quick Check:

    Create controller command = make:controller [OK]
Quick Trick: Use 'make:controller' to create controllers fast [OK]
Common Mistakes:
  • Using 'create:controller' instead of 'make:controller'
  • Omitting the colon ':' in the command
  • Using 'generate' which is not an Artisan command

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes