Skip to main content
DELETE
/
subcategories
/
{id}
curl --location --request DELETE 'https://api.yourapp.com/subcategories/1' \
--header 'Accept: application/json'
{
  "success": true,
  "message": "Subcategory deleted successfully",
  "data": null
}
This endpoint deletes a specific subcategory from the database. The subcategory is soft-deleted, meaning it’s marked as deleted but not permanently removed from the database.

Authentication

This endpoint does not require authentication.

Path Parameters

id
integer
required
The unique identifier of the subcategory to delete

Response

success
boolean
Indicates if the request was successful
message
string
A success message confirming the deletion
curl --location --request DELETE 'https://api.yourapp.com/subcategories/1' \
--header 'Accept: application/json'
{
  "success": true,
  "message": "Subcategory deleted successfully",
  "data": null
}

Notes

  • The Subcategory model uses soft deletes (SoftDeletes trait), so deleted subcategories are not permanently removed from the database.
  • Soft-deleted records have their deleted_at timestamp set and are excluded from normal queries.
  • If the subcategory has related articles, the deletion may fail depending on your database foreign key constraints.

Build docs developers (and LLMs) love