Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel eloquent duplicate record

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

$newTask = $task->replicate();
$newTask->project_id = 16; // the new project_id
$newTask->save();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #eloquent #duplicate #record
ADD COMMENT
Topic
Name
6+9 =