This project is a RESTful API for a TodoList application built using Laravel 11 with Laravel Sanctum for token-based authentication via Bearer Tokens.
The API provides full CRUD functionality to manage user-specific tasks with secure access control.
- 🔐 User Registration, Login, and Logout using Laravel Sanctum
- ✅ CRUD (Create, Read, Update, Delete) for Tasks
- 👤 Each user can only access their own tasks
- 📄 Request validation using FormRequest
- 🧱 Clean and structured REST API architecture
- Framework: Laravel 11
- Authentication: Laravel Sanctum
- Database: MySQL
- Documentation: Postman Public Documentation
- Version Control: Git + GitHub
Below is the database structure used in this project.
📊 ERD File: app/ERD/ER-DIAGRAM_TODOS.drawio
-
Clone this repository:
https://github.com/sheiza31/TODOLIST-REST-API.git
-
Navigate to the project directory:
cd TODOLIST-REST-API -
Install dependencies:
composer install
-
Create the
.envfile and configure the database:cp .env.example .env php artisan key:generate
-
Run database migrations:
php artisan migrate
-
Start the development server:
php artisan serve
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/register |
Register a new user |
| POST | /api/login |
Log in and obtain a token |
| POST | /api/logout |
Log out and revoke active token |
| GET | /api/tasks |
Retrieve all tasks for the user |
| POST | /api/tasks |
Create a new task |
| GET | /api/tasks/{id} |
Retrieve details of a specific task |
| PUT | /api/tasks/{id} |
Update a task’s status |
| DELETE | /api/tasks/{id} |
Delete a task |
Name: Sheiza Fakhru Rasyid
GitHub: sheiza31
Email: seizzafr@example.com