samedi 19 septembre 2020

saving dropdown list value in laravel

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.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire