root 4 jaren geleden
bovenliggende
commit
0fca665905
1 gewijzigde bestanden met toevoegingen van 4 en 1 verwijderingen
  1. 4
    1
      app/Http/Controllers/Api/CompoundResourceController.php

+ 4
- 1
app/Http/Controllers/Api/CompoundResourceController.php Bestand weergeven

{ {
//for compound numbering //for compound numbering
$countKPD = $this->compound->withTrashed()->count(); $countKPD = $this->compound->withTrashed()->count();
$kpd = 'KPD'.$countKPD;


$no_siri = date('yn').'-'.$countKPD.'-0'; $no_siri = date('yn').'-'.$countKPD.'-0';


//only for compound parkir //only for compound parkir
$compoundData = [ $compoundData = [
'jenis' => 'Parkir', 'jenis' => 'Parkir',
'kpd' => 'KPD'.$countKPD,
'kpd' => $kpd,
'nama' => '-', 'nama' => '-',
'identity' => '-', 'identity' => '-',
'alamat' => '-', 'alamat' => '-',
$file = ConfidentialFile::create($fileData); $file = ConfidentialFile::create($fileData);
$saved = $file->compound()->create($compoundData); $saved = $file->compound()->create($compoundData);



if($saved){ if($saved){


// $compound = Compound::with('ConfidentialFile')->where('kpd',$kpd)->first(); // $compound = Compound::with('ConfidentialFile')->where('kpd',$kpd)->first();
return $this->sendResponse($data, 'Berjaya simpan rekod kompaun!'); return $this->sendResponse($data, 'Berjaya simpan rekod kompaun!');


} }
return $this->sendError('', 'Tidak berjaya simpan rekod kompaun!');
} }
return $this->sendResponse('Tidak Berjaya!', 'Kesalahan tidak dijumpai!'); return $this->sendResponse('Tidak Berjaya!', 'Kesalahan tidak dijumpai!');
} }

Laden…
Annuleren
Opslaan