0

I am using Laravel 5.2, with composer this package (https://github.com/kbariotis/feedly-api) have installed.

but that not work :(

app/Http/Controllers/TestController.php

$feedly = new Feedly(new feedly\Mode\SandBoxMode(), new feedly\AccessTokenStorage\AccessTokenSessionStorage());

saying the class was not found.

Fatal error: Class 'App\Http\Controllers\feedly\Feedly' not found

there is my package this path:/vendor/kbariotis/feedly-api/src/feedly/Feedly.php

/vendor/kbariotis/feedly-api/src/feedly/Feedly.php

Amir Hosseinzadeh
  • 7,360
  • 4
  • 18
  • 33

1 Answers1

2

Please add to top of file, before defining class of controller:

use \feedly\Feedly;
use \feedly\Mode\SandBoxMode AS FeedlyMode;
use \feedly\AccessTokenStorage\AccessTokenSessionStorage AS FeedlyAccessTokenStorage;

Then use it like:

$feedly = new Feedly(new FeedlyMode(), new FeedlyAccessTokenStorage());

Other howtos are in example

num8er
  • 18,604
  • 3
  • 43
  • 57
  • Fatal error: Class 'feedly\Feedly\Feedly' not found – Amir Hosseinzadeh Apr 16 '16 at 12:33
  • @AmirHoseinzade check latest answer. Also seems like You're new to OOP, read about namespaces in PHP, and You'll understand why it happen. Also use IDE like PHP Storm, it will show You errors. – num8er Apr 16 '16 at 12:36
  • 1
    use feedly; $feedly = new feedly\Feedly(new feedly\Mode\SandBoxMode(), new feedly\AccessTokenStorage\AccessTokenSessionStorage()); – Amir Hosseinzadeh Apr 16 '16 at 22:06
  • Yes, You do right. Same thing as my example. Mine just defining exact component names that will be used. – num8er Apr 16 '16 at 22:15