1

I use this code:

require_once __DIR__."/vendor/autoload.php";

use League\OAuth2\Server\AuthorizationServer;
use League\OAuth2\Server\Exception\OAuthServerException;
use League\OAuth2\Server\Grant\PasswordGrant;
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;

$clientRepository = new ClientRepository();

But I get error :

Fatal error: Uncaught Error: Class 'ClientRepository' not found in /home/a/public_html/app/oauth2.php:23 Stack trace: #0 {main} thrown in /home/a/public_html/app/oauth2.php on line 23

1 Answers1

0

Maybe, you forgot namespace:

require_once __DIR__."/vendor/autoload.php";

use League\OAuth2\Server\AuthorizationServer;
use League\OAuth2\Server\Exception\OAuthServerException;
use League\OAuth2\Server\Grant\PasswordGrant;
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;

use NamespaceClass\ClientRepository; <-- edit

$clientRepository = new ClientRepository();
Dmitry Leiko
  • 3,970
  • 3
  • 25
  • 42