Answer the question
In order to leave comments, you need to log in
How to add data from one table to another in Laravel?
There are two tables table1 and table2 with identical fields. It is necessary to transfer the data from table1 to table2 on the button from the form.
I wrote something like this in the controller:
$t=Table1::all();
Table2::create($t);
Answer the question
In order to leave comments, you need to log in
this is the simplest sql query
https://www.w3schools.com/sql/sql_insert_into_sele...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question