I'm trying to achieve subtracting two integer values different tables, this is what I have tried so far.
Controller:
$amount = DB::table('shipping_datas')->where('amount')->first();
$payment = DB::table('payments')->where('amount')->first();
$balance = $amount - $payment;
Blade:
{{ $balance }}
Thank you in advance :)
$amount = DB::table('shipping_datas')->pluck('amount')->sum();
$payment = DB::table('payments')->pluck('amount')->sum();
$balance = $amount - $payment;
i think its work.