<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;

class CountryController extends Controller
{
    public function index()
    {
        $path = storage_path('app/countries.json');
        
        if (file_exists($path)) {
            $json = file_get_contents($path);
            $data = json_decode($json, true);
            
            return response()->json([
                'success' => true,
                'data' => $data
            ]);
        }

        return response()->json([
            'success' => false,
            'message' => 'Countries data not found'
        ], 404);
    }
}
