In this guide, we’ll create a Users Management API using Laravel 12, JWT authentication, and User CRUD operations.
We’ll also test everything step by step with Postman.
Step 1: User CRUD Controller
Generate controller:
Edit app/Http/Controllers/Api/UserController.php:
Step 2: User Management Routes
| Method | URI | Action | Controller Method |
|---|---|---|---|
| GET | /users | List all users | index |
| POST | /users | Create a new user | store |
| GET | /users/{id} | Show a user | show |
| PUT | /users/{id} | Update a user | update |
| DELETE | /users/{id} | Delete a user | destroy |
Step 3: Define API Routes
Edit routes/api.php:
Step 4: Test with Postman
👉 Base URL: http://127.0.0.1:8000/api
1. Register User
POST /auth/register
Body (JSON):
2. Login User
POST /auth/login
Body (JSON):
Response:
Copy the token.
3. Get Profile
GET /auth/profile
Headers:
4. Logout
POST /auth/logout
Headers:
5. List Users
GET /users
Headers:
6. Create User
POST /users
Headers:
Body (JSON):
7. Show User
GET /users/2
Headers:
8. Update User
PUT /users/2
Headers:
Body (JSON):
9. Delete User
DELETE /users/2
Headers:
✅ Conclusion
You now have:
-
JWT Authentication (register, login, profile, logout)
-
Full User CRUD (list, create, show, update, delete)
-
Complete Postman examples with request/response JSON
🚀 This is production-ready and can be extended with:
-
Password reset 🔑
-
Email verification 📧
-
User activity logs 📊
-
API rate limiting ⚡
Want the full source code?
Download the complete Laravel 12 JWT API Authentication example on my GitHub repo here.
Happy Coding!

