1

I've added a repository git as a composer dependency to my project.

"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"
    },

In this repository there is a Client class :

<?php

namespace RecastAI;

/**
 * Class Client
 * @package RecastAI
 */
class Client { ... }

When i try to use it.

<?php

use RecastAI\Client;

[...]

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

[...]

It seems that he cant find it :

[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:
Sébastien
  • 21
  • 3
Neabfi
  • 4,411
  • 3
  • 32
  • 42

1 Answers1

-2

You should try this in your composer.json:

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

And keep the require section as you have it, perform composer install, and that's it.

oscar.rpr
  • 678
  • 1
  • 6
  • 23