selectedPembiayaan = $this->getPembiayaanFromNorujukan(); $this->pembiayaanAkanDilelong = $this->getPembiayaanAkanDilelong(); return [ 'totalSagInCartInput' => [ new PilihMinimumSatuSAG, new NorujukanTidakAkanDilelong($this->pembiayaanAkanDilelong), new NorujukanBukanFasa2($this->pembiayaanAkanDilelong), new NorujukanNotAttemptPaymentRecently, new CawanganPermitUjrahPayment($this->selectedPembiayaan), new PaymentNotUjrah($this->selectedPembiayaan), new NorujukanContractNotExceed12Month($this->selectedPembiayaan), ] ]; } public function getPembiayaanFromNorujukan() { $norujukanList = json_decode($this->totalSagInCartInput); return array_map(fn($x) => Http::arrahn()->get('/api/gadai/norujukan/' . $x)->json()[0][0], $norujukanList); } public function getPembiayaanAkanDilelong() { return (new InformationController())->pembiayaanakandilelong()->getData(); } }