To add a record from another table using Eloquent, you can use the create method on the model for the table you want to add the record to. Here's an example:
$otherRecord = OtherModel::find($id); // get the record from the other table
$newRecord = NewModel::create([
'field1' => $otherRecord->field1,
'field2' => $otherRecord->field2,
// add any other fields you need to populate
]);
In this example, we're getting a record from the OtherModel table using its id, and then creating a new record in the NewModel table using the values from the OtherModel record.
You can modify this example to fit your specific use case. For example, if you want to add a record to tbcontacorrente using values from tbdiario, you could do something like this:
$diarioRecord = tbdiario::find($id); // get the record from tbdiario
tbcontacorrente::create([
'docto' => $diarioRecord->docto,
// add any other fields you need to populate
]);
This would create a new record in tbcontacorrente using the docto value from the tbdiario record.