<?php

namespace App\Http\Controllers;

use App\Models\Personal;
use App\Models\Academic;
use App\Models\FamilyMember;
use App\Models\Familymembers;
use App\Models\Financial;
use App\Models\Property;
use App\Models\SiblingsScholarship;
use Illuminate\Http\Request;

class SeefController extends Controller
{
    public function getAllData()
    {
        try {
            $personal = Personal::all();
            $academics = Academic::all();
            $familyMembers = Familymembers::all();
            $financial = Financial::all();
            $property = Property::all();
            $siblings = SiblingsScholarship::all();

            // Add more queries for other models as needed

            return response()->json([
                'success' => true,
                'data' => [
                    'personal' => $personal,
                    'academics' => $academics,
                    'familyMembers' => $familyMembers,
                    'financial' => $financial,
                    'property' => $property,
                    'siblings' => $siblings,
                    // Add more data arrays for other models
                ],
            ], 200);
        } catch (\Exception $e) {
            return response()->json([
                'success' => false,
                'message' => 'Failed to fetch data',
                'error' => $e->getMessage(),
            ], 500);
        }
    }

    // Add more methods here for specific model data fetching if needed
}
