I need assistance please. The scenario: I have a table called users and transactions in laravel. Created a blade for transaction table which will pull data as user id drop down list from users table. All user id of users table are show in transaction with dropdown lists. Transaction table has amount column with debit/credit options. User table has total amount column.
My controller -
DB::table('users')->where('userid', $request->userid)->increment('amount', $request->amount); and DB::table('users')->where('userid', $request->userid)->decrement('amount', $request->amount);
What I want to achieve
Currently, the dropdown list is working and save data in transaction table but amount can’t be debited or credited in total amount in user tables.
$request->userid is not getting value from dropdown list.
Please how do I achieve this? Thank you.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3kyTaz6
via IFTTT
Aucun commentaire:
Enregistrer un commentaire