Remove All Tables
Permalink
How do I remove all tables from the package during uninstallation process?
This is for implementing in own package
Declare an uninstall method in the package controller. First call the parent uninstall, then drop tables using drop table if exists
public function uninstall() { parent::uninstall(); $db = $this->app->make('database')->connection(); $db->executeQuery('DROP TABLE IF EXISTS myPackageTableName'); }
Ok, Thanks
With most packages, a lot depends on the package. Some will clean up all tables. Others may not, sometimes deliberately so in order to facilitate uninstalling and reinstalling while keeping data.