Obtener el árbol de categorías
GET/api/get-all-categories
Devuelve el árbol de categorías: las categorías raíz (category_father_id en null) ordenadas por nombre, cada una con su relación children anidada hasta tres niveles, también ordenada por nombre. Responde con un arreglo.
Permiso
Sección titulada «Permiso»No exige un permiso del módulo: el método getAllInTree no llama a ninguna política. Basta con estar autenticado.
curl -X GET \ "https://servererp.allendostmen.app/api/get-all-categories" \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json"const response = await fetch( "https://servererp.allendostmen.app/api/get-all-categories", { method: "GET", headers: { Authorization: `Bearer ${token}`, Accept: "application/json", }, },);const data = await response.json();use Illuminate\Support\Facades\Http;
$response = Http::withToken($token) ->acceptJson() ->get('https://servererp.allendostmen.app/api/get-all-categories');Árbol de categorías200
[ { "id": 1, "name": "Cables", "description": "Cables eléctricos", "image": null, "thumbnail": null, "level": 1, "category_father_id": null, "status": "activo", "previous_status": null, "status_update_comment": null, "status_update_date": null, "status_update_user_id": null, "create_user_id": 1, "update_user_id": null, "delete_user_id": null, "restore_user_id": null, "created_at": "2026-11-19T10:40:15.000000Z", "updated_at": "2026-11-19T10:40:15.000000Z", "deleted_at": null, "children": [ { "id": 2, "name": "Cables de cobre", "description": null, "image": null, "thumbnail": null, "level": 2, "category_father_id": 1, "status": "activo", "previous_status": null, "status_update_comment": null, "status_update_date": null, "status_update_user_id": null, "create_user_id": 1, "update_user_id": null, "delete_user_id": null, "restore_user_id": null, "created_at": "2026-11-19T10:40:15.000000Z", "updated_at": "2026-11-19T10:40:15.000000Z", "deleted_at": null, "children": [] } ] }]