Riverworks Logo

Duplicate Custom OctoberCMS Plugin Model

October CMS

Example from Mckee on how to duplicate a Segment:

// Run:
php artisan tinker

//Find your correct model path, and model ID, then run: 

use RiverworksMarketing\Segments\Models\Segment;

Segment::find(2)->replicate()->save();

// Or use one-liner: 

RiverworksMarketing\Segments\Models\Segment::find(2)->replicate()->save();