namespace App\Providers; use App\Models\ApiUser; use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Contracts\Auth\UserProvider; use Illuminate\Contracts\Encryption\EncryptException; use Illuminate\Http\Client\Response; use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\Http; use Tymon\JWTAuth\Facades\JWTAuth; class ApiUserProvider implements UserProvider { public function retrieveById($identifier) { //identifier value is 0. die('retrieveById'); } public function retrieveByToken($identifier, $token) { die('retrieveByToken'); } public function updateRememberToken(Authenticatable $user, $token) { die('updateRememberToken'); } public function retrieveByCredentials(array $credentials) { if (! array_key_exists('login', $credentials)) {return null;} if (! array_key_exists('password', $credentials)) {return null;} $response = $this->loginWithApi($credentials['login'], $credentials['password']); // if (!$response->ok()) {return null;} $userData = $response->json(); $payload['name'] = $userData['data']['player']['name']; try { $identifier = \json_encode($payload, \JSON_THROW_ON_ERROR); $payload['id'] = Crypt::encryptString($identifier); } catch (\JsonException $exception) { return null; } catch (EncryptException $exception) { return null; } return new ApiUser($payload); } public function validateCredentials(Authenticatable $user, array $credentials) { return true; } private function loginWithApi(string $login, string $password): Response { return } } Class 'App\Providers\ApiUserProvider' not found (500 Internal Server Error)

Symfony Exception

Error

HTTP 500 Internal Server Error

Class 'App\Providers\ApiUserProvider' not found

Exception

Error

  1.      * @return void
  2.      */
  3.     public function register($provider)
  4.     {
  5.         if (! $provider instanceof ServiceProvider) {
  6.             $provider = new $provider($this);
  7.         }
  8.         if (array_key_exists($providerName get_class($provider), $this->loadedProviders)) {
  9.             return;
  10.         }
Application->register('App\\Providers\\ApiUserProvider') in /home/reactivecrmkools/public_html/api/v1_cestino/bootstrap/app.php (line 97)
  1. */
  2. // $app->register(App\Providers\AppServiceProvider::class);
  3.  $app->register(App\Providers\AuthServiceProvider::class);
  4. // $app->register(App\Providers\EventServiceProvider::class);
  5. $app->register(App\Providers\ApiUserProvider::class);
  6. /*
  7. |--------------------------------------------------------------------------
  8. | Load The Application Routes
  9. |--------------------------------------------------------------------------
require('/home/reactivecrmkools/public_html/api/v1_cestino/bootstrap/app.php') in /home/reactivecrmkools/public_html/api/v1_cestino/public/index.php (line 14)
  1. | of the application / container and bootstraps the application so it
  2. | is ready to receive HTTP / Console requests from the environment.
  3. |
  4. */
  5. $app = require __DIR__.'/../bootstrap/app.php';
  6. /*
  7. |--------------------------------------------------------------------------
  8. | Run The Application
  9. |--------------------------------------------------------------------------

Stack Trace

Error
Error:
Class 'App\Providers\ApiUserProvider' not found

  at /home/reactivecrmkools/public_html/api/v1_cestino/vendor/laravel/lumen-framework/src/Application.php:223
  at Laravel\Lumen\Application->register('App\\Providers\\ApiUserProvider')
     (/home/reactivecrmkools/public_html/api/v1_cestino/bootstrap/app.php:97)
  at require('/home/reactivecrmkools/public_html/api/v1_cestino/bootstrap/app.php')
     (/home/reactivecrmkools/public_html/api/v1_cestino/public/index.php:14)