1// Retrieve the first task
2$task = Task::first();
3
4$newTask = $task->replicate();
5$newTask->project_id = 16; // the new project_id
6$newTask->save();
1$users = Users::all();
2$usersUnique = $users->unique('id');
3$usersDupes = $users->diff($usersUnique);
4
5dd($users, $usersUnique, $usersDupes);