<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\DocumentationCategory;

class DocumentationCategoryController extends Controller
{
    public function index()
    {
        $categories = DocumentationCategory::whereNull('parent_id')
            ->with('childrenRecursive')
            ->orderBy('name')
            ->get();

        return response()->json($categories);
    }
}
