<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use App\Models\Client;
use App\Models\Location;
use App\Models\Account;
use App\Models\Person;
use App\Models\Organization;
use App\Models\Representative;
use App\Models\Province;  
use App\Models\Commune; 
use Illuminate\Support\Str;
use App\Models\Branch;

class BranchController extends Controller
{
public function index()
{
    $branches = \App\Models\Branch::orderBy('sector')
        ->orderBy('branch_name')
        ->get();

    // Return plain array (NOT nested under "result" or "data")
    return response()->json($branches);
}

}
