0
 [ErrorException]                                                                                                                                                 

Dingo\Blueprint\Blueprint::generate() 缺少参数 4,
在第 95 行的 /Applications/XAMPP/xamppfiles/htdocs/api/vendor/dingo/api/src/Console/Command/Docs.php 中调用并定义

异常跟踪:

 () at /Applications/XAMPP/xamppfiles/htdocs/api/vendor/dingo/blueprint/src/Blueprint.php:83
 Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() at /Applications/XAMPP/xamppfiles/htdocs/api/vendor/dingo/blueprint/src/Blueprint.php:83
 Dingo\Blueprint\Blueprint->generate() at /Applications/XAMPP/xamppfiles/htdocs/api/vendor/dingo/api/src/Console/Command/Docs.php:95
 Dingo\Api\Console\Command\Docs->handle() at n/a:n/a
 call_user_func_array() at     /Applications/XAMPP/xamppfiles/htdocs/api/vendor/laravel/framework/src/Illuminate/Container/Container.php:507
 Illuminate\Container\Container->call() at /Applications/XAMPP/xamppfiles/htdocs/api/vendor/laravel/framework/src/Illuminate/Console/Command.php:150
 Illuminate\Console\Command->execute() at /Applications/XAMPP/xamppfiles/htdocs/api/vendor/symfony/console/Command/Command.php:256
 Symfony\Component\Console\Command\Command->run() at /Applications/XAMPP/xamppfiles/htdocs/api/vendor/laravel/framework/src/Illuminate/Console/Command.php:136
 Illuminate\Console\Command->run() at /Applications/XAMPP/xamppfiles/htdocs/api/vendor/symfony/console/Application.php:841
 Symfony\Component\Console\Application->doRunCommand() at /Applications/XAMPP/xamppfiles/htdocs/api/vendor/symfony/console/Application.php:189
 Symfony\Component\Console\Application->doRun() at /Applications/XAMPP/xamppfiles/htdocs/api/vendor/symfony/console/Application.php:120
 Symfony\Component\Console\Application->run() at /Applications/XAMPP/xamppfiles/htdocs/api/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:107
 Illuminate\Foundation\Console\Kernel->handle() at /Applications/XAMPP/xamppfiles/htdocs/api/artisan:36
4

2 回答 2

0

凯文的解决方案对我不起作用。(使用 laravel 5.1)

更换 Docs.php 后,Blueprint 类出现错误。

所以:

代替凯文的解决方案。我找到了一个简单的,可以在一秒钟内工作。

:)

修改文件:vendor/dingo/api/src/Console/Command/Docs.php

$contents = $this->blueprint->generate($this->getControllers(), $this->argument('name'), $this->argument('version'));

使用以下代码:

$contents = $this->blueprint->generate($this->getControllers(), $this->argument('name'), $this->argument('version'),'');

,'' 只需在函数调用的末尾添加 a ,即第四个参数的位置。

于 2017-05-07T05:01:43.457 回答
0

这已在Dingo API的 master 分支中解决,尝试将其拉入您的开发中。

IncludePath 未包含在 Dingo\Blueprint\Blueprint::generate() 函数调用中作为第四个参数。这是主分支上更新文件的链接。

于 2016-06-28T03:21:52.090 回答