<?php

namespace App\Http\Controllers;
use App\Vault;
use App\Cawangan;
use App\Tunai;
use App\AddTunai;
use App\GlDetail;
use App\Product;

use Illuminate\Http\Request;
use Carbon\Carbon;

class ProductController extends Controller
{


  public function getProduct($kodcaw)
  {
    $current = Carbon::now();
    $current = new Carbon();    

    $cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();


    $product=Product::on($cawangan['mysql'])->get();

    return response()->json($product);

  }

}