invoiceninja/sdk-php

composer installation issue

Closed this issue · 8 comments

Hello,

I am trying to install this sdk through composer and the command works just fine but after the command's execution is completed only two new files are created in my site folder i.e. composer.json and composer.lock and because of that I am not able to set token and api ur; in the config file.

The error it returns is -

Fatal error: Class 'InvoiceNinja\Config' not found in /Applications/XAMPP/xamppfiles/htdocs/bimpies_live/t.php on line 5

Can you please guide me through the process or if there is any other documentation for installation that can help me solve the issue as I am new at PHP.

Thanks!

I haven't been able to reproduce the problem.

In my test I see a vendor folder after running composer require invoiceninja/sdk-php

composer require invoiceninja/sdk-php
After running this command one more time there was created a vendor folder but still the issue remains the same.

Fatal error: Class 'InvoiceNinja\Config' not found in /Applications/XAMPP/xamppfiles/htdocs/bimpies_live/t.php on line 5

Are you including the class with use InvoiceNinja\Config;

after the composer install I have created a file named test.php and have inserted the code below

It returns the same error.

`<?php
use InvoiceNinja\Config as NinjaConfig;
use InvoiceNinja\Models\Client;

NinjaConfig::setURL('https://ninja.dev/api/v1');
NinjaConfig::setToken('kbqmfpipmw46jqgzg0rglbozkexmwiv0');
?>`

It is working now.

Thanks a lot!

Great to hear!