Update ListInstallations.php

This commit is contained in:
Bozhidar Slaveykov 2024-04-04 13:48:34 +03:00
parent d1b7078624
commit 37f895b6a4

View file

@ -28,11 +28,16 @@ class ListInstallations extends ListRecords
$scan = new MicroweberInstallationsScanner();
$scan->setPath($website->domain_public);
$installations = $scan->scanRecusrive();
if (!empty($installations)) {
foreach ($installations as $installation) {
$findInstallation = MicroweberInstallation::where('installation_path', $installation['path'])->first();
$findInstallation = MicroweberInstallation::where('installation_path', $installation['path'])
->where('website_id', $website->id)
->first();
if (!$findInstallation) {
$findInstallation = new MicroweberInstallation();
$findInstallation->website_id = $website->id;