<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\Setting;
use App\Models\WhyChooseUsCard;
use Illuminate\Http\Request;

class WhyChooseUsController extends Controller
{
    public function index()
    {
        $section = Setting::where('key', 'why_choose_us_section')->first();
        $cards = WhyChooseUsCard::all();
        
        return response()->json([
            'section' => $section ? json_decode($section->value) : null,
            'cards' => $cards,
        ]);
    }
}
