This is a straight-forward JWT Implementation with the help of the Tymon/jwt-auth
Package for Laravel 5.x Framework.
This repository includes a complete login/logout cycle, and many other package API methods for token refreshing, getting credentials, grabbing payloads, and more.
The whole documentation can be found here.
-
Create an empty database called
jwt
-
Run the migrations
-
Add a record (email/password) to the
users
table. You can use the following script withLaravel Tinker
.
$user = \App\User();
$user->name = "YOUR_NAME";
$user->email = "YOUR_EMAIL";
$user->password = bcrypt("YOUR_PASSWORD");
$user->save();
The JWT Laravel API.postman_collection.json
file it's a Postman
collection that contains all endpoints structure and examples for this repository. My setup is conformed by Laravel Valet
and MySQL5.7
.