<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use Illuminate\Http\JsonResponse;
use App\Models\Link;

class LinkController extends Controller
{
    public function index(): JsonResponse
    {
        $link = Link::first();
        $links = $link ? $link->links : [];

        return response()->json([
            'status' => 'success',
            'data' => $links
        ]);
    }
}
