<?php

namespace App\Http\Controllers\Api;

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

class PropertyApiController extends Controller
{
    public function index()
    {
        $properties = Property::where('status', 'Available')
            ->select('id', 'plot_number', 'type', 'size', 'size_unit', 'base_price')
            ->get();

        return response()->json([
            'success' => true,
            'data' => $properties
        ]);
    }
}
