All Projects → nahidulhasan → lumen-jwt-api

nahidulhasan / lumen-jwt-api

Licence: other
Lumen with JWT Authentication for API development

Programming Languages

PHP
23972 projects - #3 most used programming language
Dockerfile
14818 projects

Lumen with JWT Authentication

Basically this is a starter kit for you to integrate Lumen 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 and seeds.

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

Note:

  • You can now use:
  • POST /auth/login –> with email and password, obtain a JWT token
  • GET /posts –> anyone gets a list of all the posts in the database
  • POST /posts –> any authenticated user (using JWT, for instance) can create a post
  • PUT /posts/:post_id –> the Owner of :post_id (authenticated using JWT, for instance) can modify the post

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].