Answers for "solve duplicate record in eloquent"

PHP
0

Laravel eloquent get data without duplicates

MyModel::distinct()->get(['column_name']);
Posted by: Guest on October-24-2021
2

laravel eloquent duplicate record

// Retrieve the first task
$task = Task::first();

$newTask = $task->replicate();
$newTask->project_id = 16; // the new project_id
$newTask->save();
Posted by: Guest on April-14-2020

Browse Popular Code Answers by Language