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

Endpoint

Description

Permanently removes a task record from the database using findOrFail. If the task does not exist, Laravel returns a 404 response automatically.
Deletion is permanent and cannot be undone. There is no soft-delete or archive mechanism. Once deleted, the task record is gone from the database.

Path parameters

integer
required
The unique identifier of the task to delete.

Response

Returns a JSON object confirming deletion.

Response fields

string
A confirmation string. Value: "Task deleted successfully"

Example response

HTTP status: 200

Error response

If no task with the given id exists, Laravel’s findOrFail throws a ModelNotFoundException and returns:
HTTP status: 404

Controller code

Frontend Axios call