<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\DuaCategory;
use Illuminate\Http\Request;

class DuaCategoryController extends Controller
{
    // Get all dua categories
    public function index()
    {
        $categories = DuaCategory::all();
        return response()->json([
            'success' => true,
            'data' => $categories,
        ]);
    }

    // Get a specific dua category
    public function show($id)
    {
        $category = DuaCategory::find($id);
        if (!$category) {
            return response()->json([
                'success' => false,
                'message' => 'Dua category not found',
            ], 404);
        }
        return response()->json([
            'success' => true,
            'data' => $category,
        ]);
    }
}