Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/estebansalas94/Prueba-Soporte/llms.txt

Use this file to discover all available pages before exploring further.

This endpoint requires an active authenticated session. Unauthenticated requests are redirected to the login page.

Endpoint

GET /tasks/index

Description

Returns a JSON array of all tasks where completed = 0. Completed tasks are permanently filtered out and will not appear in this response. The frontend calls this endpoint on initial page load and after every mutating operation (create, complete, delete).

Query parameters

showAll
boolean
Optional. Passed by the Vuex fetchTasks action. Defaults to false. The current controller implementation does not filter on this value — all incomplete tasks are returned regardless. Reserved for future use.

Response

Returns a JSON array of task objects. Returns an empty array [] when no incomplete tasks exist.

Response fields

id
integer
Unique identifier for the task.
user_id
integer
ID of the user the task is assigned to.
title
string
Short title of the task. Maximum 255 characters.
description
string
Detailed description of the task. Maximum 500 characters.
completed
integer
Completion flag. Always 0 in this response — completed tasks are excluded.
created_at
string
ISO 8601 timestamp of when the task was created.
updated_at
string
ISO 8601 timestamp of when the task was last updated.

Example response

[
  {
    "id": 1,
    "user_id": 3,
    "title": "Review pull request",
    "description": "Check the open PR for the billing module.",
    "completed": 0,
    "created_at": "2026-03-18T10:00:00.000000Z",
    "updated_at": "2026-03-18T10:00:00.000000Z"
  },
  {
    "id": 2,
    "user_id": 5,
    "title": "Write unit tests",
    "description": "Cover the TaskController with feature tests.",
    "completed": 0,
    "created_at": "2026-03-18T11:30:00.000000Z",
    "updated_at": "2026-03-18T11:30:00.000000Z"
  }
]

Controller code

// app/Http/Controllers/TaskController.php

public function index()
{
    $tasks = Task::where('completed', 0)->get();
    return response()->json($tasks);
}

Frontend Axios call

// resources/js/store.js — fetchTasks action

fetchTasks({ commit }, showAll = false) {
    try {
        axios.get('/tasks/index', { params: { showAll } })
        .then(response => {
            commit('SET_TASKS', response.data);
        })
        .catch(error => {
            console.error("Error adding task:", error);
        });
    } catch (error) {
        console.error("Error fetching tasks:", error);
    }
},

Build docs developers (and LLMs) love