Awesome Open Source
Awesome Open Source

Laravel with JWT Authentication

Basically this is a starter kit for you to integrate Laravel with JWT Authentication

Quick Start

  • Clone this repo or download it's release archive and extract it somewhere

  • You may delete .git folder if you get this code via git clone

  • Run composer install

  • Configure your .env file for authenticating via database

  • Run docker-compose build

  • Run docker-compose up -d

  • Run the following command to populate database tables.

     $ docker-compose exec php php artisan migrate
    
  • Visit localhost:9007

Note:

  • You can now use:

  • POST /api/register –> Create user

    {
    	"name" : "Test User ",
    	"email" : "[email protected]",
    	"password" : "secret",
    	"password_confirmation" : "secret"
    
    }
    
    
  • POST /api/authenticate –> with email and password, obtain a JWT token

  • GET /api/user –> Get user info

And remember, JWT requires you to provide the token as a header.


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
php (16,536
api (1,692
laravel (1,653
jwt-authentication (85
jwt-token (45
jwt-auth (25