在 Laravel 中找不到作曲家存储库 git 类



我已经在我的项目中添加了一个存储库 git 作为作曲家依赖项。

"repositories": [
{
"type":"package",
"package": {
"name": "Neabfi/SDK-PHP",
"version":"3.1.2",
"source": {
"url": "https://github.com/Neabfi/SDK-PHP.git",
"type": "git",
"reference":"master"
}
}
}
],
"require": {
"Neabfi/SDK-PHP": "3.1.2"
},

在这个存储库中有一个客户端类:

<?php
namespace RecastAI;
/**
* Class Client
* @package RecastAI
*/
class Client { ... }

当我尝试使用它时。

<?php
use RecastAIClient;
[...]
$client = new Client(env('RECAST_REQUEST_TOKEN'), env('RECAST_LANGUAGE'));
[...]

似乎他找不到:

[2017-07-26 15:30:50] local.ERROR: SymfonyComponentDebugExceptionFatalThrowableError: Class 'RecastAIClient' not found in /Users/fabien/Sites/abote/app/Recast.php:20
Stack trace:

你应该在你的composer.json中尝试这个:

"repositories": [
{
"type": "git",
"url": "https://github.com/Neabfi/SDK-PHP.git"
}
],

并保持所需的部分,执行composer install,仅此而已。

最新更新