Bird
0
0

You run php artisan make:controller AdminController -resource but get an error. What is the likely cause?

medium📝 Debug Q14 of 15
Laravel - Controllers
You run php artisan make:controller AdminController -resource but get an error. What is the likely cause?
AAdminController name is reserved and cannot be used.
BThe make:controller command requires a namespace option.
CYou must run the command inside the database directory.
DThe short option <code>-resource</code> is invalid; it should be <code>--resource</code>.
Step-by-Step Solution
Solution:
  1. Step 1: Check the option syntax used

    The command uses -resource which is incorrect; Laravel requires double dashes for options.
  2. Step 2: Confirm correct option format

    The correct option is --resource with two dashes, not one.
  3. Final Answer:

    The short option -resource is invalid; it should be --resource. -> Option D
  4. Quick Check:

    Options need double dashes like --resource [OK]
Quick Trick: Use double dashes for options like --resource [OK]
Common Mistakes:
  • Using single dash for long options
  • Thinking controller names are restricted
  • Running commands outside project root

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes