<?php

namespace App\Http\Controllers;

use App\CawanganDetail;
use App\Cawangan;
use Illuminate\Http\Request;

class CawanganDetailController extends Controller
{
    public function getCawanganDetail($kodcaw){
        $cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();

        $cawangan_detail = CawanganDetail::on($cawangan['mysql'])->get();

        return response()->json($cawangan_detail);
    }
}