+ @php
+ $p = new NumberFormatter("id", NumberFormatter::SPELLOUT);
+ $result = preg_replace("/\..+/", "", $payment->amount);
+ @endphp
Jumlah :
Rp {{number_format($payment->amount)}}
+ {{ ucwords($p->format($result))}} Rupiah
diff --git a/Modules/PPDB/Http/Controllers/DataMuridController.php b/Modules/PPDB/Http/Controllers/DataMuridController.php
index ac8c120..967e3e2 100644
--- a/Modules/PPDB/Http/Controllers/DataMuridController.php
+++ b/Modules/PPDB/Http/Controllers/DataMuridController.php
@@ -151,14 +151,15 @@ public function payment($murid)
]);
if ($payment) {
- DetailPaymentSpp::create([
- 'payment_id' => $payment->id,
- 'user_id' => $murid,
- 'month' => date('F'),
- 'amount' => 300000,
- 'status' => 'unpaid',
- 'file' => null,
- ]);
+ $generate = rand(10,100);
+ DetailPaymentSpp::create([
+ 'payment_id' => $payment->id,
+ 'user_id' => $murid,
+ 'month' => date('F'),
+ 'amount' => 300 .$murid .$generate,
+ 'status' => 'unpaid',
+ 'file' => null,
+ ]);
}
DB::commit();
} catch (\ErrorException $e) {