public function cekWBS($value) { $sap = Sap::select('wbs')->where('purchase_requisition', $value)->where('purchase_requisition', '!=', 'null')->groupBy('wbs'); return true; }
public function getAjaxSelectSap(Request $request) { $q = $request->get('q'); $var = $this->type_sap($request->get('type')); if ($q != '' && $var != '') { $sap = Sap::where($var, "like", "%{$q}%")->groupBy($var)->select("{$var} as id", "{$var} as text")->limit('10')->get(); return response()->json($sap); } return []; }