Duplicate Single Page

Permalink
Hi community!

Here's situation :

Hi I'm trying to duplicate single page '/dashboard/users/search' like this :

$starter_UserSearch = Page::getByPath('/dashboard/users/search');
$parent_UserSearch  = Page::getByPath('/my-dashboard');
$UserSearch = $starter_UserSearch->duplicate($parent_UserSearch);
$UserSearch->update(array('cName' => 'My Users Search'));



but it not working...Any ideas?

Your help is very much appreciated.