Laravel JWT Authentication with Angular
- Make sure you have Laravel and Node.Js installed in your machine.
- Trace your laravel project path in terminal and Run the below command
composer require tymon/jwt-auth
3. Open the config/app.php file that resides inside your laravel project. Add the service provider within the providers
and JWTAuth facades within the alias array.
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
........................
........................
Tymon\JWTAuth\Providers\LaravelServiceProvider::class,
]
'aliases' => [
..........
'JWTAuth' => Tymon\JWTAuth\Facades\JWTAuth::class,
'JWTFactory' => Tymon\JWTAuth\Facades\JWTFactory::class,
],