Fajar

InvalidArgumentException

Posted 1 week ago by Fajar

hello

I made a comparison to apply for a loan, but I got a message

InvalidArgumentException
The values under comparison must be of the same type

controller

public function kalkulasi(Type $type, Request $request)
    {
       $request->validate([
           'jumlah_pinjaman'    => 'required|numeric|gt:minimum_jumlah_pinjaman|lte:maksimum_jumlah_pinjaman',
           'lama_angsuran'      => 'required|numeric|gt:minimum_lama_angsuran|lte:maksimum_lama_angsuran',
       ]);

       $persen = $type->bunga / 100;
       $cicilan_pokok = $request->jumlah_pinjaman / $request->lama_angsuran;
       $bunga = $request->jumlah_pinjaman * $persen / $request->lama_angsuran;
       $angsuran = $cicilan_pokok + $bunga;

       return view('loans.kalkulasi', compact('type','request','angsuran'));
    }

message leads to

 'jumlah_pinjaman'    => 'required|numeric|gt:minimum_jumlah_pinjaman|lte:maksimum_jumlah_pinjaman',

thx for your help

Please sign in or create an account to participate in this conversation.