mounirelbakkali1 / pepnow-rest-jwt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implementing JSON Web Token (JWT) in laravel 10

install required packages

composer require php-open-source-saver/jwt-auth

publish the config file

generate the secret key

configure the JWT AuthGuard in config/auth.php

by adding in guards array:

        'driver' => 'jwt',
        'provider' => 'users',
    ],

changing the default user model

by implementing the PHPOpenSourceSaver\JWTAuth\Contracts\JWTSubject interface in your user model and overriding the getJWTIdentifier() and getJWTCustomClaims() methods.

creating AuthController

About


Languages

Language:PHP 80.7%Language:Blade 18.5%Language:Shell 0.7%Language:JavaScript 0.2%