Laravel Duplicate Row
$data = Model::find(1);
$new_data = $data->replicate();
$new_data->created_at = now();
$new_data->save();
chuksokwuenu
$data = Model::find(1);
$new_data = $data->replicate();
$new_data->created_at = now();
$new_data->save();
MyModel::distinct()->get(['column_name']);
// Retrieve the first task
$task = Task::first();
$newTask = $task->replicate();
$newTask->project_id = 16; // the new project_id
$newTask->save();