FEATURE: add removing settings into uninstall method for template
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Helpers\Settings;
|
|||||||
use App\Models\ActionLogType;
|
use App\Models\ActionLogType;
|
||||||
use App\Models\Content;
|
use App\Models\Content;
|
||||||
use App\Models\Module;
|
use App\Models\Module;
|
||||||
|
use App\Models\Settings as SettingsModel;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
@@ -106,7 +107,12 @@ abstract class OnePage implements TemplateHandler
|
|||||||
*/
|
*/
|
||||||
public static function uninstall(Module $template)
|
public static function uninstall(Module $template)
|
||||||
{
|
{
|
||||||
|
// delete action log types
|
||||||
ActionLogType::whereIn('string_id', ['pageRemovedFromHomepage', 'pageAddedIntoHomepage'])
|
ActionLogType::whereIn('string_id', ['pageRemovedFromHomepage', 'pageAddedIntoHomepage'])
|
||||||
->delete();
|
->delete();
|
||||||
|
|
||||||
|
// delete settings with pages on homepage
|
||||||
|
SettingsModel::where('key', self::HOMEPAGE_PAGES_SETTINGS_KEY)
|
||||||
|
->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user