- Clone from GitHub
git clone https://github.com/jenesiszw/laravel-jwt.git <folder-name>
- Change directory to
<folder-name>
& install with composer
cd <folder-name>
composer install or composer update
- Copy env.example and rename to .env
- Add database connection & migrate tables
php artisan migrate
php artisan db:seed --class=UsersTableSeeder
- Generate app key and JWT secret
php artisan jwt:secret
php artisan key:generate
php artisan serve
- Routes
1. GET /api/test # Test route
2. POST /api/auth/logout # Logout route
3. POST /api/auth/login # Login route
4. POST /api/auth/refresh # Refresh token route
- Credentials
username: nigel
password: 12345678