<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\File;
use Illuminate\View\View;

class ApiDocumentationController extends Controller
{
    public function index(): View
    {
        $spec = File::exists(base_path('docs/openapi.yaml'))
            ? File::get(base_path('docs/openapi.yaml'))
            : 'openapi: 3.0.0';

        return view('api.docs', ['spec' => $spec]);
    }
}
