Remove Single Page via Package Controller

Permalink
Hi

As part of an ongoing Package development I have come to the point of configuring for development updates. I have mastered the configuration of a new package installation and adding Blocks and Single Pages as well as (thanks to JohntheFish) setting up a Pre-Install form to gather system information.

I am now looking into the future for when upgrades and changes are made and the place I am stuck on is how to remove/delete unwanted Single Pages from my dashboard. To add a new page I have a public declared function called Upgrade(). In here I place my new Single pages
public function upgrade() {
      SinglePage::add('/dashboard/agency_management/screen_display_manager', $pkg);
      SinglePage::add('/dashboard/agency_management/screen_display_manager/display_screens', $pkg);
}

What do I use to delete a page for instance except 'SinglePage::remove' doesnt work, neither does 'SinglePage::delete'
SinglePage::remove('/dashboard/agency_management/settings/display_screens', $pkg);

dclmedia
 
dclmedia replied on at Permalink Best Answer Reply
dclmedia
In typical fashion, I find the answer after I have posted... Here it is for the benefit of others who may need to do this in the future...
in the 'upgrade()' function add the following
$deletePage = \Page::getByPath('/dashboard/agency_management/settings/display_screens', 'APPROVED');
$deletePage->delete();


I hope this helps!