<?php

namespace App\Http\Controllers;

use App\Models\SubscriptionPlan;

class PricingController extends Controller
{
    /**
     * Display the public pricing page with live plan data from the database.
     * Any changes made by the platform admin to plans are immediately reflected here.
     */
    public function index()
    {
        $plans = SubscriptionPlan::where('is_active', true)
            ->where('name', '!=', 'free')
            ->orderBy('sort_order')
            ->orderBy('monthly_price')
            ->get();

        return view('pages.pricing', compact('plans'));
    }
}
