2017-07-26 28 views
0

我已经添加了作为作曲家依赖项的库Git。作曲库Git类未找到Laravel

"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 RecastAI\Client; 

[...] 

$client = new Client(env('RECAST_REQUEST_TOKEN'), env('RECAST_LANGUAGE')); 

[...] 

他似乎不能找到它:

[2017-07-26 15:30:50] local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Class 'RecastAI\Client' not found in /Users/fabien/Sites/abote/app/Recast.php:20 
Stack trace: 

回答

0

你应该在你composer.json试试这个:

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

并保留要求一节,你拥有它,执行composer install,就是这样。

+0

这不会改变无关 – Neabfi