Lumen (v8.x) API boilerplate with JSON Web Token Authentication
Composer (Dependency Manager for PHP)
PHP >= 8.0
MySQL >= 8.0
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Postman (To test your endpoints)
- Clone the repository with
git clone https://github.com/mangya/lumen-jwt.git <your_project_folder_name>
- Change directory to your project folder
cd <your_project_folder_name>
- Install the dependencies with
composer install
- Create database in MySQL.
- Update the your database name and credentials in the
.env
file. - Create database tables and sample data with
php artisan migrate:refresh --seed
- Run the application with
php -S localhost:8000 -t public
(MySQL service should be up and running). - Access
http://localhost:8000
and you're ready to go!
POST /api/register
Parameter | Type | Description |
---|---|---|
name |
string |
Required. Your Name |
email |
string |
Required. Your Email |
password |
string |
Required. Your Password |
password_confirmation |
string |
Required. Same as password |
POST /api/login
Parameter | Type | Description |
---|---|---|
email |
string |
Required. Your Email |
password |
string |
Required. Your Password |
All API requests under auth
middleware require a bearer roken in the Authorization header.
The Lumen JWT is open-sourced software licensed under the MIT license.
Thank you 😊