<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\Plan;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class PlanController extends Controller
{
    public function index(): JsonResponse
    {
        // Fetch all the plans from the database
        $plans = Plan::all();

        // Return the plans in JSON format
        return response()->json([
            'success' => true,
            'data' => $plans
        ]);
    }
}
