- Clone the repository
- Create a .env file in the root directory
- Copy the contents of .env.example into .env
- Create a database and add the database name, username, and password to the .env file
- Run
composer install
in the root directory - Run
php artisan key:generate
in the root directory - Run
php artisan migrate
in the root directory - Run
php artisan passport:install
in the root directory - Run
php artisan serve
in the root directory - Run
php artisan serve --host 192.168.0.1
in the root directory to serve the application on a local network. Change192.168.0.1
to your local ip address
POST /api/register
{
"name": "John Doe",
"email": "johndoe@gmail.com",
"password": "password",
}
{
"user": {
"name": "john doe",
"email": "johnDoe@gmail.com",
"updated_at": "2023-09-11T11:26:37.000000Z",
"created_at": "2023-09-11T11:26:37.000000Z",
"id": 2
},
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9....."
}
POST /api/login
{
"email": "johnDoe@gmail.com",
"password": "password",
}
{
"user": {
"id": 1,
"name": "john doe",
"email": "johnDoe1@gmail.com",
"email_verified_at": null,
"created_at": "2023-09-11T11:24:02.000000Z",
"updated_at": "2023-09-11T11:24:02.000000Z"
},
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9....."
}
POST /api/todo-category
{
"name": "individual"
}
{
"id": 1,
"name": "individual",
"created_at": "2023-09-11T11:31:45.000000Z",
"updated_at": "2023-09-11T11:31:45.000000Z"
}
POST /api/todo
{
"title": "Todo 1",
"description": "Todo 1 description",
"category_id": 1,
"due_date": "1/11/2023"
}
{
"id": 5,
"user_id": 1,
"task_category_id": 1,
"title": "Task 1",
"description": "Task description",
"due_date": "2023-01-11T00:00:00.000000Z",
"completed": 0,
"completed_at": null,
"created_at": "2023-09-11T11:49:56.000000Z",
"updated_at": "2023-09-11T11:49:56.000000Z",
"task_category": {
"id": 1,
"name": "individual",
"created_at": "2023-09-11T11:31:45.000000Z",
"updated_at": "2023-09-11T11:31:45.000000Z"
}
}
PUT /api/todo/{id}
{
"title": "Todo 1",
"description": "Todo 1 description",
"category_id": 1,
"completed": 1,
"due_date": "1/11/2023"
}
{
"id": 1,
"title": "Todo 1",
"description": "Todo 1 description",
"category_id": 1,
"due_date": "2023-11-01",
"completed": 1,
"user_id": 1,
"updated_at": "2023-09-11T11:32:37.000000Z",
"created_at": "2023-09-11T11:32:37.000000Z"
}
DELETE /api/todo/{id}
{
"message": "Todo deleted successfully"
}
GET /api/todo/
[
{
"id": 1,
"user_id": 1,
"task_category_id": 1,
"title": "Task 1",
"description": "Task description",
"due_date": "2023-01-11T00:00:00.000000Z",
"completed": 0,
"completed_at": null,
"created_at": "2023-09-11T11:36:40.000000Z",
"updated_at": "2023-09-11T11:36:40.000000Z"
},
{
"id": 2,
"user_id": 1,
"task_category_id": 1,
"title": "Task 1",
"description": "Task description",
"due_date": "2023-01-11T00:00:00.000000Z",
"completed": 0,
"completed_at": null,
"created_at": "2023-09-11T11:45:41.000000Z",
"updated_at": "2023-09-11T11:45:41.000000Z"
}
]