我正在关注教程,我的屏幕显示为空白,没有错误消息。我查看了laravel.log并得到了这个错误,但我不确定如何修复它。 以下是日志文件中的错误。
2017-04-10 14:30:40] local.ERROR: Symfony\Component\Console\Exception\RuntimeException: The "--resources" option does not exist. in /Users/aaronmk2/Desktop/CodingDojo/php/Todos/vendor/symfony/console/Input/ArgvInput.php:219
Stack trace:
#0 /Users/aaronmk2/Desktop/CodingDojo/php/Todos/vendor/symfony/console/Input/ArgvInput.php(155): Symfony\Component\Console\Input\ArgvInput->addLongOption('resources', NULL)
#1 /Users/aaronmk2/Desktop/CodingDojo/php/Todos/vendor/symfony/console/Input/ArgvInput.php(84): Symfony\Component\Console\Input\ArgvInput->parseLongOption('--resources')
#2 /Users/aaronmk2/Desktop/CodingDojo/php/Todos/vendor/symfony/console/Input/Input.php(63): Symfony\Component\Console\Input\ArgvInput->parse()
#3 /Users/aaronmk2/Desktop/CodingDojo/php/Todos/vendor/symfony/console/Command/Command.php(220): Symfony\Component\Console\Input\Input->bind(Object(Symfony\Component\Console\Input\InputDefinition))
#4 /Users/aaronmk2/Desktop/CodingDojo/php/Todos/vendor/laravel/framework/src/Illuminate/Console/Command.php(167): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#5 /Users/aaronmk2/Desktop/CodingDojo/php/Todos/vendor/symfony/console/Application.php(826): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /Users/aaronmk2/Desktop/CodingDojo/php/Todos/vendor/symfony/console/Application.php(190): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Routing\Console\ControllerMakeCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /Users/aaronmk2/Desktop/CodingDojo/php/Todos/vendor/symfony/console/Application.php(121): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /Users/aaronmk2/Desktop/CodingDojo/php/Todos/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(123): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /Users/aaronmk2/Desktop/CodingDojo/php/Todos/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 {main}
答案 0 :(得分:0)
从日志文件中,错误告诉您--resources
命令上不存在php artisan make:controller
选项。
您必须使用选项--resource
(单数)调用该命令,即:
php artisan make:controller PhotoController --resource