Bird
0
0

You want to create a controller named Admin/UserController inside a subfolder Admin. Which command is correct?

hard📝 Application Q8 of 15
Laravel - Controllers
You want to create a controller named Admin/UserController inside a subfolder Admin. Which command is correct?
Aphp artisan make:controller UserController/Admin
Bphp artisan make:controller Admin/UserController
Cphp artisan make:controller Admin-UserController
Dphp artisan make:controller Admin\UserController
Step-by-Step Solution
Solution:
  1. Step 1: Understand folder structure in controller names

    Using a slash / in the name creates subfolders inside app/Http/Controllers.
  2. Step 2: Identify correct command syntax

    php artisan make:controller Admin/UserController creates the controller inside the Admin folder.
  3. Final Answer:

    php artisan make:controller Admin/UserController -> Option B
  4. Quick Check:

    Use slash for subfolders = C [OK]
Quick Trick: Use slashes to create controllers in subfolders [OK]
Common Mistakes:
  • Using dashes instead of slashes
  • Reversing folder and controller names
  • Using backslashes which may cause errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes