Answers for "laravel duplicate record and get id"

PHP
3

duplicate record laravel

$data = Model::find(1);
$new_data = $data->replicate();
$new_data->created_at = now();
$new_data->save();
Posted by: Guest on July-03-2021
0

how to get all the records with same ID in laravel

Product::orderBy('id','desc')->where('category_id', 1)->get();
Posted by: Guest on October-19-2020

Code answers related to "laravel duplicate record and get id"

Browse Popular Code Answers by Language