table('tm_status_pernikahan')->get()->toArray(); $data = []; if ($maritalStatus){ $temp = []; foreach($maritalStatus as $d){ $temp['id'] = $d->nID; $temp['value'] = $d->sStatusPernikahan; array_push($data, $temp); } } return Helper::responseJson($data); } public function bloodType() { $bloodType = DB::connection('oldlms')->table('tm_golongan_darah')->get()->toArray(); $data = []; if ($bloodType){ $temp = []; foreach($bloodType as $d){ $temp['id'] = $d->nID; $temp['value'] = $d->sGolonganDarah; array_push($data, $temp); } } return Helper::responseJson($data); } public function relationship() { $relation = DB::connection('oldlms')->table('tm_hubungan_keluarga')->get()->toArray(); $data = []; if ($relation){ $temp = []; foreach($relation as $d){ $temp['id'] = $d->nID; $temp['value'] = $d->sHubunganKeluarga; array_push($data, $temp); } } return Helper::responseJson($data); } public function corporate(Request $request) { $search = $request->search; $corporate = DB::table('corporates') ->where('active', 1) ->where(function ($query) use ($search) { $query->where('name', 'like', "%$search%") ->orWhere('code', 'like', "%$search%"); }) ->get() ->toArray(); $data['company'] = []; if ($corporate){ $temp = []; foreach($corporate as $d){ $temp['id'] = $d->id; $temp['name'] = $d->name; $temp['linking_rule'] = json_decode($d->linking_rules); array_push($data['company'], $temp); } } return Helper::responseJson($data); } }