Laravel缺少Dingo \ Blueprint \ Blueprint :: generate()的参数4

时间:2016-06-24 06:57:04

标签: laravel dingo-api

 [ErrorException]                                                                                                                                                 

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

异常追踪:

 () 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

2 个答案:

答案 0 :(得分:0)

这已在Dingo API的主分支中得到解决,请尝试将其纳入您的开发中。

IncoutPath未作为Dingo \ Blueprint \ Blueprint :: generate()函数调用中的第4个参数包含在内。以下是主分支上更新文件的link

答案 1 :(得分:0)

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

更换Docs.php后,我的Blueprint类出错了。

所以:

取代凯文的解决方案。我发现了一个简单的一秒钟工作。

:)

修改文件: 供应商/野狗/ API / SRC /控制台/命令/ 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'),'');

只需在函数调用结束时添加,'',即第四个参数的位置。