Lumen (v8.x) API boilerplate with JSON Web Token Authentication
Composer (Dependency Manager for PHP)PHP >= 8.0MySQL >= 8.0OpenSSL PHP ExtensionPDO PHP ExtensionMbstring PHP ExtensionPostman (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
.envfile. - 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:8000and 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 😊