Get all data from one table and save it to another table using eloquent
I need some help.
I am creating a simple system, How do I get all the data from Table 1 (id, name, address, position, status) which has 2,000+ users, and save/create it all to a new table (table1_id, name, and position, month) using eloquent.
Every time I click the button it will be executed. Thank you.
#laravel
You can use the Eloquent create() method to create a new record in the second table for each record in the first table. You can use the Eloquent all() method to get all the records from the first table.