user(); $result = DB::table('user_site_settings')->updateOrInsert( ['user_id' => $user->id, 'setting_name' => 'dark_mode'], ['setting_value' => $mode] ); } }