Oh, I get this, I am not trying to update the table, I am inserting data into the table and i have tried this.
I still got this error
SQLSTATE[HY000]: General error: 1364 Field 'deduction_name' doesn't have a default value (SQL: insert into `deduction_user` (`created_at`, `deduction_id`, `updated_at`, `user_id`) values (2020-03-30 21:42:15, 6, 2020-03-30 21:42:15, 6))
I noticed the user id is been assigned to deduction id as well.
Then my deduction name and value input are been generated dynamically i.e a user can have more than one deductions
NOTE: my deductions are been loaded to the user interface from the database and each has an ID. I can access see the id on the user interface, but i have not been able to access in my store function
$deduction = Deduction::all();
$user->deductions()->attach($user->id);
$user->deductions()->attach($deduction->id, [
'deduction_name' => $request->input('deduction_name'),
'deduction_value'=> $request->input('deduction_value')
]);