jwt-auth: Unable to publish, Class 'Tymon\JWTAuth\Providers\LaravelServiceProvider' not found
Hi all,
I have installed “tymon/jwt-auth”:“1.0.0-beta.1” on Lararel 5.3.22. tymon folder was created under vendors folder, but I still received this message
[RuntimeException] Could not scan for classes inside "tests/TestCase.php" which does not appear to be a file nor a folder
I have followed instructions in https://github.com/tymondesigns/jwt-auth/issues/513 and added
Tymon\JWTAuth\Providers\LaravelServiceProvider::class in config/app.php file and tried to run php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider" but I receive this error:
[Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Tymon\JWTAuth\Providers\LaravelServiceProvider' not found
LaravelServiceProvider.php file exists in the vendors folder. I have read all posts relating to this issue but most of them are regarding older versions and they suggests same thing want I already did. Am I doing something wrong? Could anybody give me some advise? Any help would be highly appreciated. Thanks
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 31
For Laravel 5.6 use the following steps:
change the service provider from:
to:
then publish it as:
Solution for Laravel 5.5:
Add library to
composer.json:Run this command in console:
composer updateAdd provider in
config/app.php:Add aliases in the same file `config/app.php’:
And then run command in console:
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"next run:php artisan jwt:secretAnd you can configure JWTAuth in next steps in: https://github.com/tymondesigns/jwt-auth/wiki/Configuration
changed Class ‘Tymon\JWTAuth\Providers\JWTAuthServiceProvider’ to Tymon\JWTAuth\Providers\LaravelServiceProvider::class
run: php artisan vendor:publish --provider=“Tymon\JWTAuth\Providers\LaravelServiceProvider”
Solution for Laravel 5.6:
1.) Add library to composer.json:
2.) Run this command in console:
3.) Remove any
Tymon\JWTprovider fromconfig/app.php4.) Delete Laravel Cache folders to remove old dependencies:
Delete the files in following folders:
.../bootstrap/cache/services.php.../bootstrap/cache/config.php5.) And then run those commands in console:
I had the same problem, I solved this way
I removed provider from ‘config/app.php’:
I removed aliases in the same file ‘config/app.php’:
I removed ‘tymon/jwt-aut’ from composer require and i runned command in console:
composer updateI installed ‘tymon/jwt-aut’ with this command:
composer require tymon/jwt-auth dev-developI added provider in ‘config/app.php’:
I published the package config file:
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"And generated a key:
php artisan jwt:secretLaravel Framework 5.8.16
I personnaly managed to cleanely install it by using
"tymon/jwt-auth": "1.0.0-rc.1"in my composer.json. With Laravel 5.5.20.Hope it helps!
https://github.com/tymondesigns/jwt-auth/issues/url
@bachras I hit the same error. I removed all references to jwt-auth, then removed the package from composer, ran
composer update. After success I added jwt-auth, tagged at1.0.0-beta.2, rancomposer updateand then re-added references toapp.phpand rancomposer update(just to be sure).Finally, I ran:
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"Upgrade to the following for Laravel >5.5
"require-dev": { "tymon/jwt-auth": "1.0.*" },See version compatibility here
i have the same problem as jwt-auth 0.5.12 doesnt create any
so kindly go to
and check for any
and paste the .php file in
and do composer update and then do the
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"Always getting In ProviderRepository.php line 208:
Class ‘Tymon\JWTAuth\Providers\LaravelServiceProvider’ not found in Laravel 5.6
For Laravel 5.7:
<h>1) composer.json (note we need version 1.0.0-rc.3 for laravel 5.7)
2) update composer
composer update3) publish vendor
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"4) generate key
php artisan jwt:secret4) add aliases in config/app.php
@chrislow Thanks a lot! It worked for me 😃
Now in 2019, this work