Duplicate or Clone a database record with Laravel

PHOTO EMBED

Mon Nov 14 2022 10:46:17 GMT+0000 (Coordinated Universal Time)

Saved by @edsonjorgef1 #mysql #sql #mariadb

$post = Post::find(1);
$newPost = $post->replicate();
$newPost->created_at = Carbon::now();
$newPost->save();
content_copyCOPY

https://laravel-news.com/duplicate-database-record