2
votes

I am using laravel 5.7 and i install fresh laravel project and setup JWT service providers in app.php. Now i run command for publish JWT config file but i got error like this

In ProviderRepository.php line 208:

Class 'Tymon\JWT\Providers\JWTAuthServiceProvider' not found

I don't get to how to fix this.

3
did you run composer require tymon/jwt-auth?Roland Starke
i run composer require tymon/jwt-auth:0.5.*-devBeerus sama

3 Answers

1
votes

Install via composer

Run the following command to pull in the latest version:

composer require tymon/jwt-auth

Add service provider

Add the service provider to the providers array in the config/app.php config file as follows:

'providers' => [

    ...

    Tymon\JWTAuth\Providers\LaravelServiceProvider::class,
]
1
votes

Follow this link: laravel-jwt-api

Step 1: composer update

Step 2: php artisan migrate

Step 3: php artisan serve

and put post in postman

http://127.0.0.1:8000/api/auth/login

i hope it will work for you!

0
votes
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\JWTAuthServiceProvider"

php artisan config:cache

php artisan vendor:publish  and then select

Which provider or tag's files would you like to publish`enter code here`
  [0 ] Publish files from all providers and tags listed below
  [1 ] Provider: Facade\

Blockquote

Ignition\IgnitionServiceProvider [2 ] Provider: Fideloper\Proxy\TrustedProxyServiceProvider [3 ] Provider: Fruitcake\Cors\CorsServiceProvider [4 ] Provider: Illuminate\Foundation\Providers\FoundationServiceProvider [5 ] Provider: Illuminate\Mail\MailServiceProvider [6 ] Provider: Illuminate\Notifications\NotificationServiceProvider [7 ] Provider: Illuminate\Pagination\PaginationServiceProvider [8 ] Provider: Laravel\Tinker\TinkerServiceProvider [9 ] Provider: Tymon\JWTAuth\Providers\LaravelServiceProvider [10] Tag: config [11] Tag: cors [12] Tag: flare-config [13] Tag: ignition-config [14] Tag: laravel-errors [15] Tag: laravel-mail [16] Tag: laravel-notifications [17] Tag: laravel-pagination

9

Copied File [/vendor/tymon/jwt-auth/config/config.php] To [/config/jwt.php]
Publishing complete.