Commit b4a9b1cc by Triyah Fatmawati

Get data univ api

parent fd38e85b
......@@ -24,11 +24,17 @@ public function create(){
$kegiatan = Kegiatan::orderBy('id')->get();
$konferensi = Konferensi::get();
$date = Date('Y-m-d');
$universitas = DB::connection('siakadu')->table('satuan_pendidikan')
->where('soft_delete', 0)
->whereNotNull('nm_lemb')
->orderBy('id_sp')
->get();
$dataUniv = json_decode($this->getDataUniv(), true);
foreach($dataUniv as $univ){
if($univ['id_wil'] != '999999'){
$universitas[] = [
'id_sp' => $univ['id_sp'],
'nm_lemb' => $univ['nm_lemb']
];
}
}
// $lastKode = Registrasi::query()->whereDate('created_at', $date)->max('kode_registrasi');
// $nourut = sprintf("%05s", ((int) substr($lastKode, -5))+1);
// $tgldaftar = Carbon::now()->format('d-m-Y');
......@@ -270,6 +276,13 @@ private function generateVa($multipartData)
return $response->getBody()->getContents();
}
private function getDataUniv(){
$client = new Client();
$response = $client->request('GET', 'https://siakadu.unesa.ac.id/api/get_univ');
return $response->getBody()->getContents();
}
public function addFormKegiatan(Request $request)
{
$data['kegiatan'] = Kegiatan::get();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment