I want to save the same data with 365 records within one table.
I've tried with replicate(), but was unsuccessful. I tried this on the Apache server and used Laravel 5.7.
My controller
public function price_save(Request $request) {
$price = new Price();
$price->price = $request->price;
$price->extra_bed = $request->extra_bed;
$price->room_id = $request->room;
$id = $request->room;
$price = Price::find($id);
if(null !== $price) {
$new = $price->replicate();
if(null !== $new) {
$new->push();
// $price->save();
}