Bozhidar Slaveykov 1 年之前
父節點
當前提交
67cd7ec58b
共有 100 個文件被更改,包括 380 次插入496 次删除
  1. 0 1
      web/Modules/LetsEncrypt/App/Http/Controllers/LetsEncryptController.php
  2. 1 2
      web/Modules/LetsEncrypt/App/Providers/LetsEncryptServiceProvider.php
  3. 1 1
      web/Modules/LetsEncrypt/App/Providers/RouteServiceProvider.php
  4. 1 2
      web/Modules/LetsEncrypt/LetsEncryptApacheVirtualHostConfig.php
  5. 10 11
      web/Modules/LetsEncrypt/Listeners/HostingAccountIsCreatedListener.php
  6. 3 1
      web/Modules/LetsEncrypt/Providers/Filament/AdminPanelProvider.php
  7. 0 1
      web/Modules/Microweber/App/Http/Controllers/MicroweberController.php
  8. 1 4
      web/Modules/Microweber/App/Models/MicroweberInstallation.php
  9. 2 3
      web/Modules/Microweber/App/Providers/MicroweberServiceProvider.php
  10. 1 1
      web/Modules/Microweber/App/Providers/RouteServiceProvider.php
  11. 1 6
      web/Modules/Microweber/Filament/Clusters/Microweber/Pages/Settings.php
  12. 12 10
      web/Modules/Microweber/Filament/Clusters/Microweber/Pages/Version.php
  13. 3 7
      web/Modules/Microweber/Filament/Clusters/Microweber/Pages/Whitelabel.php
  14. 5 9
      web/Modules/Microweber/Filament/Clusters/Microweber/Resources/InstallationResource.php
  15. 0 1
      web/Modules/Microweber/Filament/Clusters/Microweber/Resources/InstallationResource/Pages/CreateInstallation.php
  16. 1 1
      web/Modules/Microweber/Filament/Clusters/Microweber/Resources/InstallationResource/Pages/EditInstallation.php
  17. 4 4
      web/Modules/Microweber/Filament/Clusters/Microweber/Resources/InstallationResource/Pages/ListInstallations.php
  18. 0 1
      web/Modules/Microweber/Filament/Clusters/MicroweberCluster.php
  19. 24 27
      web/Modules/Microweber/Listeners/DomainIsCreatedListener.php
  20. 1 2
      web/Modules/Microweber/MicroweberApacheVirtualHostConfig.php
  21. 3 1
      web/Modules/Microweber/Providers/Filament/AdminPanelProvider.php
  22. 7 9
      web/Modules/Microweber/Shell/Adapters/PhyreShellExecutor.php
  23. 4 4
      web/Modules/Microweber/config/config.php
  24. 7 4
      web/app/Actions/ApacheWebsiteApplySSLVirtualHost.php
  25. 30 30
      web/app/Actions/ApacheWebsiteCreate.php
  26. 4 5
      web/app/Actions/ApacheWebsiteDelete.php
  27. 4 1
      web/app/Actions/CreateLinuxUser.php
  28. 3 1
      web/app/Actions/CreateLinuxWebUser.php
  29. 1 1
      web/app/ApiClient.php
  30. 1 3
      web/app/Console/Commands/ApachePingWebsitesWithCurl.php
  31. 0 3
      web/app/Events/HostingAccountIsCreated.php
  32. 0 3
      web/app/Events/ModelCustomerCreated.php
  33. 1 3
      web/app/Events/ModelCustomerDeleting.php
  34. 0 3
      web/app/Events/ModelDomainCreated.php
  35. 1 3
      web/app/Events/ModelDomainDeleting.php
  36. 1 3
      web/app/Events/ModelHostingSubscriptionCreated.php
  37. 1 3
      web/app/Events/ModelHostingSubscriptionDeleting.php
  38. 15 17
      web/app/Filament/Pages/Modules.php
  39. 1 1
      web/app/Filament/Pages/Settings/Settings.php
  40. 0 4
      web/app/Filament/Resources/BackupResource.php
  41. 0 1
      web/app/Filament/Resources/BackupResource/Pages/CreateBackup.php
  42. 0 3
      web/app/Filament/Resources/CronJobResource.php
  43. 0 1
      web/app/Filament/Resources/CronJobResource/Pages/CreateCronJob.php
  44. 4 8
      web/app/Filament/Resources/CustomerResource.php
  45. 0 1
      web/app/Filament/Resources/CustomerResource/Pages/CreateCustomer.php
  46. 1 1
      web/app/Filament/Resources/CustomerResource/Pages/EditCustomer.php
  47. 0 1
      web/app/Filament/Resources/CustomerResource/Pages/ManageCustomers.php
  48. 10 16
      web/app/Filament/Resources/DomainResource.php
  49. 0 1
      web/app/Filament/Resources/DomainResource/Pages/CreateWebsite.php
  50. 1 1
      web/app/Filament/Resources/DomainResource/Pages/EditWebsite.php
  51. 0 2
      web/app/Filament/Resources/DomainResource/Pages/ViewWebsite.php
  52. 1 5
      web/app/Filament/Resources/HostingPlanResource.php
  53. 0 1
      web/app/Filament/Resources/HostingPlanResource/Pages/CreateHostingPlan.php
  54. 21 25
      web/app/Filament/Resources/HostingSubscriptionResource.php
  55. 0 2
      web/app/Filament/Resources/HostingSubscriptionResource/Pages/CreateHostingSubscription.php
  56. 0 1
      web/app/Filament/Resources/HostingSubscriptionResource/Pages/ManageHostingSubscriptions.php
  57. 0 3
      web/app/Filament/Resources/UserResource.php
  58. 0 1
      web/app/Filament/Resources/UserResource/Pages/CreateUser.php
  59. 9 11
      web/app/Filament/Widgets/CustomersCount.php
  60. 0 7
      web/app/Filament/Widgets/ServerDiskUsageStatistic.php
  61. 0 7
      web/app/Filament/Widgets/ServerMemoryStatistic.php
  62. 0 3
      web/app/Filament/Widgets/ServerMemoryStatisticCount.php
  63. 4 5
      web/app/Filament/Widgets/Websites.php
  64. 2 2
      web/app/FileManagerApi.php
  65. 11 5
      web/app/Http/Controllers/Api/CustomersController.php
  66. 3 3
      web/app/Http/Controllers/Api/HealthController.php
  67. 10 4
      web/app/Http/Controllers/Api/HostingPlansController.php
  68. 6 5
      web/app/Http/Controllers/Api/HostingSubscriptionsController.php
  69. 1 1
      web/app/Http/Controllers/Api/Request/AuthLoginRequest.php
  70. 2 1
      web/app/Http/Controllers/Api/Request/CustomerCreateRequest.php
  71. 2 3
      web/app/Http/Controllers/ApiController.php
  72. 5 12
      web/app/Listeners/ModelDomainCreatedListener.php
  73. 1 3
      web/app/Listeners/ModelDomainDeletingListener.php
  74. 7 7
      web/app/Listeners/ModelHostingSubscriptionCreatedListener.php
  75. 3 5
      web/app/Listeners/ModelHostingSubscriptionDeletingListener.php
  76. 3 1
      web/app/Livewire/Installer.php
  77. 0 1
      web/app/Models/Backup.php
  78. 4 5
      web/app/Models/CronJob.php
  79. 0 2
      web/app/Models/Customer.php
  80. 0 3
      web/app/Models/Domain.php
  81. 0 1
      web/app/Models/DomainSslCertificate.php
  82. 2 3
      web/app/Models/HostingDatabase.php
  83. 0 1
      web/app/Models/HostingPlan.php
  84. 1 2
      web/app/Models/HostingSubscription.php
  85. 1 1
      web/app/Models/User.php
  86. 2 3
      web/app/PhyreLaravelApplication.php
  87. 10 8
      web/app/Policies/CustomerPolicy.php
  88. 8 12
      web/app/Providers/AppServiceProvider.php
  89. 7 7
      web/app/Providers/Filament/AdminPanelProvider.php
  90. 1 2
      web/app/Settings.php
  91. 8 8
      web/app/ShellApi.php
  92. 20 24
      web/app/Statistics/ServerStatistic.php
  93. 0 1
      web/app/VirtualHosts/ApacheVirtualHostConfigBase.php
  94. 3 4
      web/app/VirtualHosts/ApacheVirtualHostManager.php
  95. 1 1
      web/composer.json
  96. 1 1
      web/composer.lock
  97. 7 7
      web/config/database.php
  98. 39 39
      web/config/filament-authentication-log.php
  99. 0 1
      web/database/migrations/2024_04_01_073021_create_domain_ssl_certificates_table.php
  100. 3 3
      web/database/seeders/DatabaseSeeder.php

+ 0 - 1
web/Modules/LetsEncrypt/App/Http/Controllers/LetsEncryptController.php

@@ -5,7 +5,6 @@ namespace Modules\LetsEncrypt\App\Http\Controllers;
 use App\Http\Controllers\Controller;
 use Illuminate\Http\RedirectResponse;
 use Illuminate\Http\Request;
-use Illuminate\Http\Response;
 
 class LetsEncryptController extends Controller
 {

+ 1 - 2
web/Modules/LetsEncrypt/App/Providers/LetsEncryptServiceProvider.php

@@ -28,7 +28,7 @@ class LetsEncryptServiceProvider extends ServiceProvider
         $this->registerViews();
         $this->loadMigrationsFrom(module_path($this->moduleName, 'Database/migrations'));
 
-       // Event::listen(HostingAccountIsCreated::class,HostingAccountIsCreatedListener::class);
+        // Event::listen(HostingAccountIsCreated::class,HostingAccountIsCreatedListener::class);
     }
 
     /**
@@ -39,7 +39,6 @@ class LetsEncryptServiceProvider extends ServiceProvider
         $this->app->register(RouteServiceProvider::class);
         $this->app->register(AdminPanelProvider::class);
 
-
         app()->virtualHostManager->registerConfig(LetsEncryptApacheVirtualHostConfig::class, $this->moduleNameLower);
     }
 

+ 1 - 1
web/Modules/LetsEncrypt/App/Providers/RouteServiceProvider.php

@@ -2,8 +2,8 @@
 
 namespace Modules\LetsEncrypt\App\Providers;
 
-use Illuminate\Support\Facades\Route;
 use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
+use Illuminate\Support\Facades\Route;
 
 class RouteServiceProvider extends ServiceProvider
 {

+ 1 - 2
web/Modules/LetsEncrypt/LetsEncryptApacheVirtualHostConfig.php

@@ -7,7 +7,6 @@ use App\VirtualHosts\ApacheVirtualHostConfigBase;
 class LetsEncryptApacheVirtualHostConfig extends ApacheVirtualHostConfigBase
 {
     public array $phpAdminValueOpenBaseDirs = [
-        '/usr/share/letsencrypt'
+        '/usr/share/letsencrypt',
     ];
-
 }

+ 10 - 11
web/Modules/LetsEncrypt/Listeners/HostingAccountIsCreatedListener.php

@@ -6,8 +6,8 @@ use App\Actions\ApacheWebsiteApplySSLVirtualHost;
 use App\ApiClient;
 use App\Events\HostingAccountIsCreated;
 use App\FileManagerApi;
-use App\Models\HostingPlan;
 use App\Models\DomainSslCertificate;
+use App\Models\HostingPlan;
 use App\Settings;
 use App\ShellApi;
 
@@ -27,16 +27,16 @@ class HostingAccountIsCreatedListener
     public function handle(HostingAccountIsCreated $event): void
     {
         $findWebsite = \App\Models\Domain::where('id', $event->model->id)->first();
-        if (!$findWebsite) {
+        if (! $findWebsite) {
             return;
         }
 
         $findHostingPlan = HostingPlan::where('id', $findWebsite->hosting_plan_id)->first();
-        if (!$findHostingPlan) {
+        if (! $findHostingPlan) {
             return;
         }
 
-        if (!in_array('letsencrypt', $findHostingPlan->additional_services)) {
+        if (! in_array('letsencrypt', $findHostingPlan->additional_services)) {
             return;
         }
 
@@ -53,13 +53,13 @@ class HostingAccountIsCreatedListener
         ])->render();
 
         $fmApi = new FileManagerApi();
-        $fmApi->filePutContents($event->model->domain_root . '/acme-config.yaml', $acmeConfigYaml);
+        $fmApi->filePutContents($event->model->domain_root.'/acme-config.yaml', $acmeConfigYaml);
 
-        $amePHPPharFile = base_path() . '/Modules/LetsEncrypt/Actions/acmephp.phar';
+        $amePHPPharFile = base_path().'/Modules/LetsEncrypt/Actions/acmephp.phar';
 
         $phyrePHP = ApiClient::getPhyrePHP();
 
-        $command = $phyrePHP . ' ' . $amePHPPharFile . ' run ' . $event->model->domain_root . '/acme-config.yaml';
+        $command = $phyrePHP.' '.$amePHPPharFile.' run '.$event->model->domain_root.'/acme-config.yaml';
         ShellApi::exec($command);
 
         $validateCertificates = [];
@@ -71,13 +71,13 @@ class HostingAccountIsCreatedListener
         $sslCertificateKeyFileContent = $fmApi->fileGetContents($sslCertificateKeyFilePath);
         $sslCertificateChainFileContent = $fmApi->fileGetContents($sslCertificateChainFilePath);
 
-        if (!empty($sslCertificateChainFileContent)) {
+        if (! empty($sslCertificateChainFileContent)) {
             $validateCertificates['certificate'] = $sslCertificateFileContent;
         }
-        if (!empty($sslCertificateKeyFileContent)) {
+        if (! empty($sslCertificateKeyFileContent)) {
             $validateCertificates['private_key'] = $sslCertificateKeyFileContent;
         }
-        if (!empty($sslCertificateChainFileContent)) {
+        if (! empty($sslCertificateChainFileContent)) {
             $validateCertificates['certificate_chain'] = $sslCertificateChainFileContent;
         }
         if (count($validateCertificates) !== 3) {
@@ -106,6 +106,5 @@ class HostingAccountIsCreatedListener
         $applySSLVirtualHost->setSslCertificateChainFilePath($sslCertificateChainFilePath);
         $applySSLVirtualHost->handle();
 
-
     }
 }

+ 3 - 1
web/Modules/LetsEncrypt/Providers/Filament/AdminPanelProvider.php

@@ -20,10 +20,12 @@ use Illuminate\View\Middleware\ShareErrorsFromSession;
 
 class AdminPanelProvider extends PanelProvider
 {
-    private string $module = "LetsEncrypt";
+    private string $module = 'LetsEncrypt';
+
     public function panel(Panel $panel): Panel
     {
         $moduleNamespace = $this->getModuleNamespace();
+
         return $panel
             ->id('Lets Encrypt ::admin')
             ->path('admin/modules/letsencrypt')

+ 0 - 1
web/Modules/Microweber/App/Http/Controllers/MicroweberController.php

@@ -5,7 +5,6 @@ namespace Modules\Microweber\App\Http\Controllers;
 use App\Http\Controllers\Controller;
 use Illuminate\Http\RedirectResponse;
 use Illuminate\Http\Request;
-use Illuminate\Http\Response;
 
 class MicroweberController extends Controller
 {

+ 1 - 4
web/Modules/Microweber/App/Models/MicroweberInstallation.php

@@ -3,18 +3,15 @@
 namespace Modules\Microweber\App\Models;
 
 use App\Models\Domain;
-use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\Factories\HasFactory;
-use Modules\Microweber\Database\factories\MicroweberInstallationFactory;
+use Illuminate\Database\Eloquent\Model;
 
 class MicroweberInstallation extends Model
 {
     use HasFactory;
 
-
     public function domain()
     {
         return $this->hasOne(Domain::class, 'id', 'domain_id');
     }
-
 }

+ 2 - 3
web/Modules/Microweber/App/Providers/MicroweberServiceProvider.php

@@ -2,12 +2,11 @@
 
 namespace Modules\Microweber\App\Providers;
 
+use App\Events\DomainIsCreated;
 use Illuminate\Support\Facades\Blade;
 use Illuminate\Support\Facades\Event;
 use Illuminate\Support\ServiceProvider;
-use App\Events\DomainIsCreated;
 use Modules\Microweber\Listeners\DomainIsCreatedListener;
-use App\VirtualHosts\ApacheVirtualHostManager;
 use Modules\Microweber\MicroweberApacheVirtualHostConfig;
 
 class MicroweberServiceProvider extends ServiceProvider
@@ -28,7 +27,7 @@ class MicroweberServiceProvider extends ServiceProvider
         $this->registerViews();
         $this->loadMigrationsFrom(module_path($this->moduleName, 'Database/migrations'));
 
-        Event::listen(DomainIsCreated::class,DomainIsCreatedListener::class);
+        Event::listen(DomainIsCreated::class, DomainIsCreatedListener::class);
     }
 
     /**

+ 1 - 1
web/Modules/Microweber/App/Providers/RouteServiceProvider.php

@@ -2,8 +2,8 @@
 
 namespace Modules\Microweber\App\Providers;
 
-use Illuminate\Support\Facades\Route;
 use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
+use Illuminate\Support\Facades\Route;
 
 class RouteServiceProvider extends ServiceProvider
 {

+ 1 - 6
web/Modules/Microweber/Filament/Clusters/Microweber/Pages/Settings.php

@@ -2,11 +2,8 @@
 
 namespace Modules\Microweber\Filament\Clusters\Microweber\Pages;
 
-use Filament\Forms\Components\Card;
-use Filament\Forms\Components\Radio;
 use Filament\Forms\Components\Section;
 use Filament\Forms\Components\Select;
-use Filament\Forms\Components\Tabs;
 use Filament\Forms\Components\TextInput;
 use Modules\Microweber\Filament\Clusters\MicroweberCluster;
 use Outerweb\FilamentSettings\Filament\Pages\Settings as BaseSettings;
@@ -21,7 +18,6 @@ class Settings extends BaseSettings
 
     protected static ?int $navigationSort = 3;
 
-
     public function schema(): array
     {
         return [
@@ -71,7 +67,6 @@ class Settings extends BaseSettings
                         ])
                         ->label('Allow customers to choose installation type'),
 
-
                     Select::make('microweber.allow_customers_to_choose_installation_database_driver')
                         ->options([
                             'yes' => 'Yes',
@@ -133,6 +128,6 @@ class Settings extends BaseSettings
                         ->label('Allow resellers to use their own White Label'),
 
                 ]),
-            ];
+        ];
     }
 }

+ 12 - 10
web/Modules/Microweber/Filament/Clusters/Microweber/Pages/Version.php

@@ -24,12 +24,14 @@ class Version extends Page
     protected static ?int $navigationSort = 1;
 
     public $currentVersionOfApp = 0;
+
     public $latestVersionOfApp = 0;
+
     public $latestDownloadDateOfApp = 0;
 
     public $supportedTemplates = [];
-    public $supportedLanguages = [];
 
+    public $supportedLanguages = [];
 
     protected function getViewData(): array
     {
@@ -51,7 +53,7 @@ class Version extends Page
             'totalAppTemplates' => count($this->supportedTemplates),
             'appTemplates' => $this->supportedTemplates,
             'supportedLanguages' => $this->supportedLanguages,
-            'supportedTemplates' => $this->supportedTemplates
+            'supportedTemplates' => $this->supportedTemplates,
         ];
 
     }
@@ -60,12 +62,12 @@ class Version extends Page
     {
         $sharedAppPath = config('microweber.sharedPaths.app');
 
-        if (!is_dir(dirname($sharedAppPath))) {
+        if (! is_dir(dirname($sharedAppPath))) {
             mkdir(dirname($sharedAppPath));
         }
 
         $shellPath = '/usr/local/phyre/web/vendor/microweber-packages/shared-server-scripts/shell-scripts';
-        ShellApi::exec('chmod +x ' . $shellPath . '/*');
+        ShellApi::exec('chmod +x '.$shellPath.'/*');
 
         // Download core app
         $status = $this->__getMicroweberDownloaderInstance()
@@ -88,7 +90,7 @@ class Version extends Page
         // The module connector must have own instance of composer client
         $composerClient = new Client();
         $composerClient->packageServers = [
-            'https://market.microweberapi.com/packages/microweberserverpackages/packages.json'
+            'https://market.microweberapi.com/packages/microweberserverpackages/packages.json',
         ];
 
         return $composerClient;
@@ -97,11 +99,11 @@ class Version extends Page
     private function __getComposerLicensedInstance()
     {
         $composerClientLicensed = new Client();
-//        if (Option::getOption('license_key_status', 'whitelabel_license') == 'valid') {
-//            $composerClientLicensed->addLicense([
-//                'local_key' => Option::getOption('license_key', 'whitelabel_license')
-//            ]);
-//        }
+        //        if (Option::getOption('license_key_status', 'whitelabel_license') == 'valid') {
+        //            $composerClientLicensed->addLicense([
+        //                'local_key' => Option::getOption('license_key', 'whitelabel_license')
+        //            ]);
+        //        }
 
         return $composerClientLicensed;
     }

+ 3 - 7
web/Modules/Microweber/Filament/Clusters/Microweber/Pages/Whitelabel.php

@@ -6,7 +6,6 @@ use Filament\Forms\Components\Checkbox;
 use Filament\Forms\Components\Section;
 use Filament\Forms\Components\Textarea;
 use Filament\Forms\Components\TextInput;
-use Filament\Pages\Page;
 use Modules\Microweber\Filament\Clusters\MicroweberCluster;
 use Outerweb\FilamentSettings\Filament\Pages\Settings as BaseSettings;
 
@@ -22,13 +21,12 @@ class Whitelabel extends BaseSettings
 
     protected static ?string $navigationLabel = 'Whitelabel';
 
-
-    public static function getNavigationLabel() : string
+    public static function getNavigationLabel(): string
     {
         return self::$navigationLabel;
     }
 
-    public function getTitle() : string
+    public function getTitle(): string
     {
         return self::$navigationLabel;
     }
@@ -84,12 +82,10 @@ class Whitelabel extends BaseSettings
                     Checkbox::make('microweber.whitelabel.enable_microweber_service_links')
                         ->label('Enable Microweber Service Links'),
 
-
                     Textarea::make('microweber.whitelabel.admin_colors_sass')
                         ->label('Enter "Admin colors" sass'),
 
-
-                ])
+                ]),
         ];
     }
 }

+ 5 - 9
web/Modules/Microweber/Filament/Clusters/Microweber/Resources/InstallationResource.php

@@ -2,14 +2,11 @@
 
 namespace Modules\Microweber\Filament\Clusters\Microweber\Resources;
 
-use Modules\Microweber\App\Models\MicroweberInstallation;
-use Filament\Forms;
 use Filament\Forms\Form;
 use Filament\Resources\Resource;
 use Filament\Tables;
 use Filament\Tables\Table;
-use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\SoftDeletingScope;
+use Modules\Microweber\App\Models\MicroweberInstallation;
 use Modules\Microweber\Filament\Clusters\Microweber\Resources\InstallationResource\Pages\ListInstallations;
 use Modules\Microweber\Filament\Clusters\MicroweberCluster;
 
@@ -27,7 +24,6 @@ class InstallationResource extends Resource
 
     protected static ?int $navigationSort = 0;
 
-
     public static function form(Form $form): Form
     {
         return $form
@@ -44,9 +40,9 @@ class InstallationResource extends Resource
                 Tables\Columns\TextColumn::make('website.domain')->label('Domain'),
                 Tables\Columns\TextColumn::make('app_version')->label('Version'),
                 Tables\Columns\TextColumn::make('installation_type')->label('Type'),
-         //       Tables\Columns\TextColumn::make('installation_path')->label('Path'),
+                //       Tables\Columns\TextColumn::make('installation_path')->label('Path'),
                 Tables\Columns\TextColumn::make('template')->label('Template'),
-//                Tables\Columns\TextColumn::make('admin_email')->label('Admin Email'),
+                //                Tables\Columns\TextColumn::make('admin_email')->label('Admin Email'),
 
             ])
             ->filters([
@@ -73,8 +69,8 @@ class InstallationResource extends Resource
     {
         return [
             'index' => ListInstallations::route('/'),
-//            'create' => Pages\CreateInstallation::route('/create'),
-//            'edit' => Pages\EditInstallation::route('/{record}/edit'),
+            //            'create' => Pages\CreateInstallation::route('/create'),
+            //            'edit' => Pages\EditInstallation::route('/{record}/edit'),
         ];
     }
 }

+ 0 - 1
web/Modules/Microweber/Filament/Clusters/Microweber/Resources/InstallationResource/Pages/CreateInstallation.php

@@ -2,7 +2,6 @@
 
 namespace Modules\Microweber\Filament\Clusters\Microweber\Resources\InstallationResource\Pages;
 
-use Filament\Actions;
 use Filament\Resources\Pages\CreateRecord;
 use Modules\Microweber\Filament\Clusters\Microweber\Resources\InstallationResource;
 

+ 1 - 1
web/Modules/Microweber/Filament/Clusters/Microweber/Resources/InstallationResource/Pages/EditInstallation.php

@@ -2,9 +2,9 @@
 
 namespace Modules\Microweber\Filament\Clusters\Microweber\Resources\InstallationResource\Pages;
 
-use Modules\Microweber\Filament\Admin\Resources\InstallationResource;
 use Filament\Actions;
 use Filament\Resources\Pages\EditRecord;
+use Modules\Microweber\Filament\Admin\Resources\InstallationResource;
 
 class EditInstallation extends EditRecord
 {

+ 4 - 4
web/Modules/Microweber/Filament/Clusters/Microweber/Resources/InstallationResource/Pages/ListInstallations.php

@@ -17,7 +17,7 @@ class ListInstallations extends ListRecords
     {
         return [
             Actions\CreateAction::make(),
-            Actions\Action::make('Scan for installations')->action('scanForInstallations')
+            Actions\Action::make('Scan for installations')->action('scanForInstallations'),
         ];
     }
 
@@ -31,14 +31,14 @@ class ListInstallations extends ListRecords
 
             $installations = $scan->scanRecusrive();
 
-            if (!empty($installations)) {
+            if (! empty($installations)) {
                 foreach ($installations as $installation) {
 
                     $findInstallation = MicroweberInstallation::where('installation_path', $installation['path'])
                         ->where('domain_id', $domain->id)
                         ->first();
 
-                    if (!$findInstallation) {
+                    if (! $findInstallation) {
                         $findInstallation = new MicroweberInstallation();
                         $findInstallation->domain_id = $domain->id;
                         $findInstallation->installation_path = $installation['path'];
@@ -62,7 +62,7 @@ class ListInstallations extends ListRecords
         $getAppInstallations = MicroweberInstallation::get();
         if ($getAppInstallations != null) {
             foreach ($getAppInstallations as $appInstallation) {
-                if (!is_file($appInstallation['installation_path'] . '/config/microweber.php')) {
+                if (! is_file($appInstallation['installation_path'].'/config/microweber.php')) {
                     $appInstallation->delete();
                 }
             }

+ 0 - 1
web/Modules/Microweber/Filament/Clusters/MicroweberCluster.php

@@ -9,5 +9,4 @@ class MicroweberCluster extends Cluster
     protected static ?string $navigationIcon = 'heroicon-o-squares-2x2';
 
     protected static ?string $navigationGroup = 'Server Management';
-
 }

+ 24 - 27
web/Modules/Microweber/Listeners/DomainIsCreatedListener.php

@@ -6,9 +6,7 @@ use App\Events\DomainIsCreated;
 use App\Models\Domain;
 use App\Models\HostingPlan;
 use App\Models\HostingSubscription;
-use App\ShellApi;
 use Modules\Microweber\App\Models\MicroweberInstallation;
-use Psy\Shell;
 
 class DomainIsCreatedListener
 {
@@ -26,20 +24,20 @@ class DomainIsCreatedListener
     public function handle(DomainIsCreated $event): void
     {
         $findDomain = Domain::where('id', $event->model->id)->first();
-        if (!$findDomain) {
+        if (! $findDomain) {
             return;
         }
         $findHostingSubscription = HostingSubscription::where('id', $findDomain->hosting_subscription_id)->first();
-        if (!$findHostingSubscription) {
+        if (! $findHostingSubscription) {
             return;
         }
 
         $findHostingPlan = HostingPlan::where('id', $findHostingSubscription->hosting_plan_id)->first();
-        if (!$findHostingPlan) {
+        if (! $findHostingPlan) {
             return;
         }
 
-        if (!in_array('microweber', $findHostingPlan->additional_services)) {
+        if (! in_array('microweber', $findHostingPlan->additional_services)) {
             return;
         }
 
@@ -60,7 +58,7 @@ class DomainIsCreatedListener
         $install->setLanguage($installationLanguage);
         $install->setTemplate($installationTemplate);
 
-      //  $install->setStandaloneInstallation();
+        //  $install->setStandaloneInstallation();
         $install->setSymlinkInstallation();
         $install->setDatabaseDriver('sqlite');
 
@@ -68,33 +66,32 @@ class DomainIsCreatedListener
         $install->setAdminUsername('bojotjo');
         $install->setAdminPassword('bojotjo');
 
-          $status =  $install->run();
+        $status = $install->run();
 
-          if (isset($status['success']) && $status['success']) {
+        if (isset($status['success']) && $status['success']) {
 
-              $findInstallation = MicroweberInstallation::where('installation_path', $findDomain->domain_public)
-                  ->where('domain_id', $findDomain->id)
-                  ->first();
+            $findInstallation = MicroweberInstallation::where('installation_path', $findDomain->domain_public)
+                ->where('domain_id', $findDomain->id)
+                ->first();
 
-              if (!$findInstallation) {
-                  $findInstallation = new MicroweberInstallation();
-                  $findInstallation->domain_id = $findDomain->id;
-                  $findInstallation->installation_path = $findDomain->domain_public;
-              }
+            if (! $findInstallation) {
+                $findInstallation = new MicroweberInstallation();
+                $findInstallation->domain_id = $findDomain->id;
+                $findInstallation->installation_path = $findDomain->domain_public;
+            }
 
-              $findInstallation->app_version = 'latest';
-              $findInstallation->template = $installationTemplate;
+            $findInstallation->app_version = 'latest';
+            $findInstallation->template = $installationTemplate;
 
-              if ($installationType == 'symlink') {
-                  $findInstallation->installation_type = 'symlink';
-              } else {
-                  $findInstallation->installation_type = 'standalone';
-              }
+            if ($installationType == 'symlink') {
+                $findInstallation->installation_type = 'symlink';
+            } else {
+                $findInstallation->installation_type = 'standalone';
+            }
 
-              $findInstallation->save();
-
-          }
+            $findInstallation->save();
 
+        }
 
     }
 }

+ 1 - 2
web/Modules/Microweber/MicroweberApacheVirtualHostConfig.php

@@ -7,7 +7,6 @@ use App\VirtualHosts\ApacheVirtualHostConfigBase;
 class MicroweberApacheVirtualHostConfig extends ApacheVirtualHostConfigBase
 {
     public array $phpAdminValueOpenBaseDirs = [
-        '/usr/share/microweber'
+        '/usr/share/microweber',
     ];
-
 }

+ 3 - 1
web/Modules/Microweber/Providers/Filament/AdminPanelProvider.php

@@ -20,10 +20,12 @@ use Illuminate\View\Middleware\ShareErrorsFromSession;
 
 class AdminPanelProvider extends PanelProvider
 {
-    private string $module = "Microweber";
+    private string $module = 'Microweber';
+
     public function panel(Panel $panel): Panel
     {
         $moduleNamespace = $this->getModuleNamespace();
+
         return $panel
             ->id('microweber::admin')
             ->path('microweber/admin')

+ 7 - 9
web/Modules/Microweber/Shell/Adapters/PhyreShellExecutor.php

@@ -1,15 +1,13 @@
 <?php
+
 namespace Modules\Microweber\Shell\Adapters;
 
 use App\ShellApi;
 use MicroweberPackages\SharedServerScripts\Shell\Adapters\IShellExecutor;
-use MicroweberPackages\SharedServerScripts\Shell\Adapters\pm_ApiCli;
 
 class PhyreShellExecutor implements IShellExecutor
 {
     /**
-     * @param string $file
-     * @param array $args
      * @return mixed
      */
     public function executeFile(string $file, array $args)
@@ -23,12 +21,12 @@ class PhyreShellExecutor implements IShellExecutor
     {
         $commandAsLine = implode(' ', $command);
 
-//        dd([
-//            'command' => $command,
-//            'path' => $path,
-//            'args' => $args,
-//            'commandAsLine' => $commandAsLine
-//        ]);
+        //        dd([
+        //            'command' => $command,
+        //            'path' => $path,
+        //            'args' => $args,
+        //            'commandAsLine' => $commandAsLine
+        //        ]);
         return ShellApi::exec($commandAsLine);
     }
 }

+ 4 - 4
web/Modules/Microweber/config/config.php

@@ -2,10 +2,10 @@
 
 return [
     'name' => 'Microweber',
-    'sharedPaths'=>[
-        'app'=>'/usr/share/microweber/latest',
-        'modules'=>'/usr/share/microweber/latest/userfiles/modules',
-        'templates'=>'/usr/share/microweber/latest/userfiles/templates'
+    'sharedPaths' => [
+        'app' => '/usr/share/microweber/latest',
+        'modules' => '/usr/share/microweber/latest/userfiles/modules',
+        'templates' => '/usr/share/microweber/latest/userfiles/templates',
     ],
 
 ];

+ 7 - 4
web/app/Actions/ApacheWebsiteApplySSLVirtualHost.php

@@ -8,12 +8,15 @@ use App\ShellApi;
 class ApacheWebsiteApplySSLVirtualHost
 {
     public $domain;
+
     public $domainRoot;
 
     public $domainPublic;
 
     public $sslCertificateFilePath;
+
     public $sslCertificateKeyFilePath;
+
     public $sslCertificateChainFilePath;
 
     public function setSslCertificateFilePath($sslCertificateFilePath)
@@ -49,7 +52,7 @@ class ApacheWebsiteApplySSLVirtualHost
     public function handle()
     {
         $settings = [
-            'port'=> 443,
+            'port' => 443,
             'domain' => $this->domain,
             'domainRoot' => $this->domainRoot,
             'domainPublic' => $this->domainPublic,
@@ -58,16 +61,16 @@ class ApacheWebsiteApplySSLVirtualHost
             'sslCertificateKeyFilePath' => $this->sslCertificateKeyFilePath,
             'sslCertificateChainFilePath' => $this->sslCertificateChainFilePath,
         ];
-        $apache2SSLSample = view('actions.samples.ubuntu.apache2-ssl-conf',$settings)->render();
+        $apache2SSLSample = view('actions.samples.ubuntu.apache2-ssl-conf', $settings)->render();
 
         $fileManagerApi = new FileManagerApi();
 
         $apache2SSLOptionsSample = view('actions.samples.ubuntu.apache2-ssl-options-conf')->render();
         $apache2SSLOptionsFilePath = '/etc/apache2/phyre/options-ssl-apache.conf';
-        if (!$fileManagerApi->isDir('/etc/apache2/phyre')) {
+        if (! $fileManagerApi->isDir('/etc/apache2/phyre')) {
             $fileManagerApi->mkdir('/etc/apache2/phyre');
         }
-        if (!$fileManagerApi->fileExists($apache2SSLOptionsFilePath)) {
+        if (! $fileManagerApi->fileExists($apache2SSLOptionsFilePath)) {
             $fileManagerApi->filePutContents($apache2SSLOptionsFilePath, $apache2SSLOptionsSample);
         }
 

+ 30 - 30
web/app/Actions/ApacheWebsiteCreate.php

@@ -2,18 +2,20 @@
 
 namespace App\Actions;
 
-use App\FileManagerApi;
-use App\ShellApi;
-use App\VirtualHosts\ApacheVirtualHostManager;
-
 class ApacheWebsiteCreate
 {
     public $domain;
+
     public $user;
+
     public $email;
+
     public $password;
+
     public $isMainDomain = false;
+
     public $additionalServices = [];
+
     public $features = [];
 
     public function setDomain($domain)
@@ -62,15 +64,15 @@ class ApacheWebsiteCreate
         }
 
         if ($this->isMainDomain) {
-            $allDomainsRoot = '/home/' . $this->user . '/public_html';
-            $domainRoot = '/home/' . $this->user;
-            $domainPublic = '/home/' . $this->user . '/public_html';
-            $homeRoot = '/home/' . $this->user;
+            $allDomainsRoot = '/home/'.$this->user.'/public_html';
+            $domainRoot = '/home/'.$this->user;
+            $domainPublic = '/home/'.$this->user.'/public_html';
+            $homeRoot = '/home/'.$this->user;
         } else {
-            $allDomainsRoot = '/home/' . $this->user . '/domains';
-            $domainRoot = '/home/' . $this->user . '/domains/' . $this->domain;
-            $domainPublic = $domainRoot . '/public_html';
-            $homeRoot = '/home/' . $this->user;
+            $allDomainsRoot = '/home/'.$this->user.'/domains';
+            $domainRoot = '/home/'.$this->user.'/domains/'.$this->domain;
+            $domainPublic = $domainRoot.'/public_html';
+            $homeRoot = '/home/'.$this->user;
         }
 
         $apacheVirtualHostConfigs = app()->virtualHostManager->getConfigs($this->additionalServices);
@@ -89,23 +91,22 @@ class ApacheWebsiteCreate
         $settings = array_merge($settings, $apacheVirtualHostConfigs);
         $apache2Sample = view('actions.samples.ubuntu.apache2-conf', $settings)->render();
 
-        if (!is_dir($homeRoot)) {
+        if (! is_dir($homeRoot)) {
             mkdir($homeRoot);
         }
-        if (!is_dir($allDomainsRoot)) {
+        if (! is_dir($allDomainsRoot)) {
             mkdir($allDomainsRoot);
         }
-        if (!is_dir($domainRoot)) {
+        if (! is_dir($domainRoot)) {
             mkdir($domainRoot);
         }
-        if (!is_dir($domainPublic)) {
+        if (! is_dir($domainPublic)) {
             mkdir($domainPublic);
         }
 
         shell_exec('chmod -R 775 /etc/apache2/sites-available/');
 
-        file_put_contents('/etc/apache2/sites-available/' . $settings['domain'] . '.conf', $apache2Sample);
-
+        file_put_contents('/etc/apache2/sites-available/'.$settings['domain'].'.conf', $apache2Sample);
 
         $indexContent = '
 
@@ -115,22 +116,21 @@ class ApacheWebsiteCreate
 
 ';
 
+        file_put_contents($settings['domainPublic'].'/index.php', $indexContent);
 
-        file_put_contents($settings['domainPublic'] . '/index.php', $indexContent);
-
-        shell_exec('chown -R ' . $settings['user'] . ':' . $settings['group'] . ' ' . $allDomainsRoot);
-        shell_exec('chown -R ' . $settings['user'] . ':' . $settings['group'] . ' ' . $homeRoot);
+        shell_exec('chown -R '.$settings['user'].':'.$settings['group'].' '.$allDomainsRoot);
+        shell_exec('chown -R '.$settings['user'].':'.$settings['group'].' '.$homeRoot);
 
-        shell_exec('chown -R ' . $settings['user'] . ':' . $settings['group'] . ' ' . $settings['domainRoot']);
-        shell_exec('chown -R ' . $settings['user'] . ':' . $settings['group'] . ' ' . $settings['domainPublic']);
+        shell_exec('chown -R '.$settings['user'].':'.$settings['group'].' '.$settings['domainRoot']);
+        shell_exec('chown -R '.$settings['user'].':'.$settings['group'].' '.$settings['domainPublic']);
 
-        shell_exec('chmod -R 775 ' . $allDomainsRoot);
-        shell_exec('chmod -R 775 ' . $homeRoot);
+        shell_exec('chmod -R 775 '.$allDomainsRoot);
+        shell_exec('chmod -R 775 '.$homeRoot);
 
-        shell_exec('chmod -R 775 ' . $settings['domainRoot']);
-        shell_exec('chmod -R 775 ' . $settings['domainPublic']);
+        shell_exec('chmod -R 775 '.$settings['domainRoot']);
+        shell_exec('chmod -R 775 '.$settings['domainPublic']);
 
-        shell_exec('a2ensite ' . $settings['domain'] . '.conf');
+        shell_exec('a2ensite '.$settings['domain'].'.conf');
         shell_exec('systemctl reload apache2');
 
         return [
@@ -141,7 +141,7 @@ class ApacheWebsiteCreate
             'user' => $this->user,
             'email' => $this->email,
             'linuxUser' => $linuxUser,
-            'apache2Sample' => $apache2Sample
+            'apache2Sample' => $apache2Sample,
         ];
 
     }

+ 4 - 5
web/app/Actions/ApacheWebsiteDelete.php

@@ -16,18 +16,17 @@ class ApacheWebsiteDelete
     public function handle()
     {
         $apacheConf = '/etc/apache2/sites-available/'.$this->domain.'.conf';
-        ShellApi::exec('rm -rf ' . $apacheConf);
+        ShellApi::exec('rm -rf '.$apacheConf);
 
         $apacheConfEnabled = '/etc/apache2/sites-enabled/'.$this->domain.'.conf';
-        ShellApi::exec('rm -rf ' . $apacheConfEnabled);
-
+        ShellApi::exec('rm -rf '.$apacheConfEnabled);
 
         // SSL
         $apacheSSLConf = '/etc/apache2/sites-available/'.$this->domain.'-ssl.conf';
-        ShellApi::exec('rm -rf ' . $apacheSSLConf);
+        ShellApi::exec('rm -rf '.$apacheSSLConf);
 
         $apacheSSLConfEnabled = '/etc/apache2/sites-enabled/'.$this->domain.'-ssl.conf';
-        ShellApi::exec('rm -rf ' . $apacheSSLConfEnabled);
+        ShellApi::exec('rm -rf '.$apacheSSLConfEnabled);
 
     }
 }

+ 4 - 1
web/app/Actions/CreateLinuxUser.php

@@ -7,7 +7,9 @@ use App\ShellApi;
 class CreateLinuxUser
 {
     public $username;
+
     public $email;
+
     public $password;
 
     public function setUsername($username)
@@ -29,6 +31,7 @@ class CreateLinuxUser
     {
         $this->isWebUser = true;
     }
+
     public function handle()
     {
         $output = '';
@@ -41,7 +44,7 @@ class CreateLinuxUser
         $output .= ShellApi::exec($command);
 
         $command = 'echo '.$username.':'.$password.' | sudo chpasswd -e';
-        $output .=  ShellApi::exec($command);
+        $output .= ShellApi::exec($command);
 
         return $output;
     }

+ 3 - 1
web/app/Actions/CreateLinuxWebUser.php

@@ -7,7 +7,9 @@ use App\ShellApi;
 class CreateLinuxWebUser
 {
     public $username;
+
     public $email;
+
     public $password;
 
     public function setUsername($username)
@@ -33,7 +35,7 @@ class CreateLinuxWebUser
         $command = 'groupadd '.$username;
         $output .= ShellApi::exec($command);
 
-        $command = 'usermod -a -G www-data ' . $username;
+        $command = 'usermod -a -G www-data '.$username;
         $output .= ShellApi::exec($command);
 
         $command = 'echo '.$username.':'.$password.' | chpasswd -e';

+ 1 - 1
web/app/ApiClient.php

@@ -6,6 +6,6 @@ class ApiClient
 {
     public static function getPhyrePHP()
     {
-        return "/usr/local/phyre/php/bin/php";
+        return '/usr/local/phyre/php/bin/php';
     }
 }

+ 1 - 3
web/app/Console/Commands/ApachePingWebsitesWithCurl.php

@@ -42,7 +42,7 @@ class ApachePingWebsitesWithCurl extends Command
         }
 
         // Retrieve all website configurations from the database
-       $websiteConfigs = Domain::get();
+        $websiteConfigs = Domain::get();
 
         foreach ($websiteConfigs as $config) {
             $domain = $config->domain;
@@ -57,8 +57,6 @@ class ApachePingWebsitesWithCurl extends Command
 
         }
 
-
-
         return 0;
     }
 }

+ 0 - 3
web/app/Events/HostingAccountIsCreated.php

@@ -2,11 +2,8 @@
 
 namespace App\Events;
 
-use Illuminate\Broadcasting\Channel;
 use Illuminate\Broadcasting\InteractsWithSockets;
-use Illuminate\Broadcasting\PresenceChannel;
 use Illuminate\Broadcasting\PrivateChannel;
-use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
 use Illuminate\Foundation\Events\Dispatchable;
 use Illuminate\Queue\SerializesModels;
 

+ 0 - 3
web/app/Events/ModelCustomerCreated.php

@@ -2,11 +2,8 @@
 
 namespace App\Events;
 
-use Illuminate\Broadcasting\Channel;
 use Illuminate\Broadcasting\InteractsWithSockets;
-use Illuminate\Broadcasting\PresenceChannel;
 use Illuminate\Broadcasting\PrivateChannel;
-use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
 use Illuminate\Foundation\Events\Dispatchable;
 use Illuminate\Queue\SerializesModels;
 

+ 1 - 3
web/app/Events/ModelCustomerDeleting.php

@@ -2,11 +2,8 @@
 
 namespace App\Events;
 
-use Illuminate\Broadcasting\Channel;
 use Illuminate\Broadcasting\InteractsWithSockets;
-use Illuminate\Broadcasting\PresenceChannel;
 use Illuminate\Broadcasting\PrivateChannel;
-use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
 use Illuminate\Foundation\Events\Dispatchable;
 use Illuminate\Queue\SerializesModels;
 
@@ -15,6 +12,7 @@ class ModelCustomerDeleting
     use Dispatchable, InteractsWithSockets, SerializesModels;
 
     public $model;
+
     /**
      * Create a new event instance.
      */

+ 0 - 3
web/app/Events/ModelDomainCreated.php

@@ -2,11 +2,8 @@
 
 namespace App\Events;
 
-use Illuminate\Broadcasting\Channel;
 use Illuminate\Broadcasting\InteractsWithSockets;
-use Illuminate\Broadcasting\PresenceChannel;
 use Illuminate\Broadcasting\PrivateChannel;
-use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
 use Illuminate\Foundation\Events\Dispatchable;
 use Illuminate\Queue\SerializesModels;
 

+ 1 - 3
web/app/Events/ModelDomainDeleting.php

@@ -2,11 +2,8 @@
 
 namespace App\Events;
 
-use Illuminate\Broadcasting\Channel;
 use Illuminate\Broadcasting\InteractsWithSockets;
-use Illuminate\Broadcasting\PresenceChannel;
 use Illuminate\Broadcasting\PrivateChannel;
-use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
 use Illuminate\Foundation\Events\Dispatchable;
 use Illuminate\Queue\SerializesModels;
 
@@ -15,6 +12,7 @@ class ModelDomainDeleting
     use Dispatchable, InteractsWithSockets, SerializesModels;
 
     public $model;
+
     /**
      * Create a new event instance.
      */

+ 1 - 3
web/app/Events/ModelHostingSubscriptionCreated.php

@@ -2,11 +2,8 @@
 
 namespace App\Events;
 
-use Illuminate\Broadcasting\Channel;
 use Illuminate\Broadcasting\InteractsWithSockets;
-use Illuminate\Broadcasting\PresenceChannel;
 use Illuminate\Broadcasting\PrivateChannel;
-use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
 use Illuminate\Foundation\Events\Dispatchable;
 use Illuminate\Queue\SerializesModels;
 
@@ -15,6 +12,7 @@ class ModelHostingSubscriptionCreated
     use Dispatchable, InteractsWithSockets, SerializesModels;
 
     public $model;
+
     /**
      * Create a new event instance.
      */

+ 1 - 3
web/app/Events/ModelHostingSubscriptionDeleting.php

@@ -2,11 +2,8 @@
 
 namespace App\Events;
 
-use Illuminate\Broadcasting\Channel;
 use Illuminate\Broadcasting\InteractsWithSockets;
-use Illuminate\Broadcasting\PresenceChannel;
 use Illuminate\Broadcasting\PrivateChannel;
-use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
 use Illuminate\Foundation\Events\Dispatchable;
 use Illuminate\Queue\SerializesModels;
 
@@ -15,6 +12,7 @@ class ModelHostingSubscriptionDeleting
     use Dispatchable, InteractsWithSockets, SerializesModels;
 
     public $model;
+
     /**
      * Create a new event instance.
      */

+ 15 - 17
web/app/Filament/Pages/Modules.php

@@ -16,47 +16,45 @@ class Modules extends Page
 
     protected static ?int $navigationSort = 1;
 
-
     protected function getViewData(): array
     {
         return [
             'categories' => [
-                'Security'=>[
+                'Security' => [
                     [
                         'name' => 'Lets Encrypt',
                         'description' => 'Automatically secure your website with a free SSL certificate from Lets Encrypt.',
                         'url' => url('admin/letsencrypt'),
                         'iconUrl' => url('images/modules/letsencrypt.png'),
-                        'category' => 'Security'
+                        'category' => 'Security',
                     ],
                 ],
-                'Content Management'=>[
+                'Content Management' => [
                     [
                         'name' => 'Microweber',
                         'description' => 'A drag and drop website builder and a powerful next-generation CMS.',
                         'url' => url('admin/microweber'),
                         'iconUrl' => url('images/modules/microweber.png'),
-                        'category' => 'Content Management'
+                        'category' => 'Content Management',
                     ],
                     [
-                        'name'=>'WordPress',
-                        'description'=>'WordPress is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database.',
+                        'name' => 'WordPress',
+                        'description' => 'WordPress is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database.',
                         'url' => url('admin/wordpress'),
-                        'iconUrl'=>url('images/modules/wordpress.svg'),
-                        'category'=>'Content Management'
-                    ]
+                        'iconUrl' => url('images/modules/wordpress.svg'),
+                        'category' => 'Content Management',
+                    ],
                 ],
-                'E-Commerce'=>[
+                'E-Commerce' => [
                     [
-                        'name'=>'OpenCart',
-                        'description'=>'A free shopping cart system. OpenCart is an open source PHP-based online e-commerce solution.',
+                        'name' => 'OpenCart',
+                        'description' => 'A free shopping cart system. OpenCart is an open source PHP-based online e-commerce solution.',
                         'url' => url('admin/opencart'),
-                        'iconUrl'=>url('images/modules/opencart.png'),
-                        'category'=>'E-Commerce'
+                        'iconUrl' => url('images/modules/opencart.png'),
+                        'category' => 'E-Commerce',
                     ],
                 ],
-            ]
+            ],
         ];
     }
-
 }

+ 1 - 1
web/app/Filament/Pages/Settings/Settings.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace App\Filament\Pages\Settings;
 
 use Closure;
@@ -8,7 +9,6 @@ use Outerweb\FilamentSettings\Filament\Pages\Settings as BaseSettings;
 
 class Settings extends BaseSettings
 {
-
     protected static ?string $navigationGroup = 'Server Management';
 
     protected static ?int $navigationSort = 2;

+ 0 - 4
web/app/Filament/Resources/BackupResource.php

@@ -3,15 +3,11 @@
 namespace App\Filament\Resources;
 
 use App\Filament\Resources\BackupResource\Pages;
-use App\Filament\Resources\BackupResource\RelationManagers;
 use App\Models\Backup;
-use Filament\Forms;
 use Filament\Forms\Form;
 use Filament\Resources\Resource;
 use Filament\Tables;
 use Filament\Tables\Table;
-use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\SoftDeletingScope;
 
 class BackupResource extends Resource
 {

+ 0 - 1
web/app/Filament/Resources/BackupResource/Pages/CreateBackup.php

@@ -3,7 +3,6 @@
 namespace App\Filament\Resources\BackupResource\Pages;
 
 use App\Filament\Resources\BackupResource;
-use Filament\Actions;
 use Filament\Resources\Pages\CreateRecord;
 
 class CreateBackup extends CreateRecord

+ 0 - 3
web/app/Filament/Resources/CronJobResource.php

@@ -3,15 +3,12 @@
 namespace App\Filament\Resources;
 
 use App\Filament\Resources\CronJobResource\Pages;
-use App\Filament\Resources\CronJobResource\RelationManagers;
 use App\Models\CronJob;
 use Filament\Forms;
 use Filament\Forms\Form;
 use Filament\Resources\Resource;
 use Filament\Tables;
 use Filament\Tables\Table;
-use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\SoftDeletingScope;
 
 class CronJobResource extends Resource
 {

+ 0 - 1
web/app/Filament/Resources/CronJobResource/Pages/CreateCronJob.php

@@ -3,7 +3,6 @@
 namespace App\Filament\Resources\CronJobResource\Pages;
 
 use App\Filament\Resources\CronJobResource;
-use Filament\Actions;
 use Filament\Resources\Pages\CreateRecord;
 
 class CreateCronJob extends CreateRecord

+ 4 - 8
web/app/Filament/Resources/CustomerResource.php

@@ -3,16 +3,12 @@
 namespace App\Filament\Resources;
 
 use App\Filament\Resources\CustomerResource\Pages;
-use App\Filament\Resources\CustomerResource\RelationManagers;
 use App\Models\Customer;
-use Faker\Provider\Text;
 use Filament\Forms;
 use Filament\Forms\Form;
 use Filament\Resources\Resource;
 use Filament\Tables;
 use Filament\Tables\Table;
-use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\SoftDeletingScope;
 
 class CustomerResource extends Resource
 {
@@ -71,7 +67,7 @@ class CustomerResource extends Resource
                     ->sortable(),
                 Tables\Columns\TextColumn::make('email')
                     ->searchable()
-                    ->sortable()
+                    ->sortable(),
             ])
             ->defaultSort('id', 'desc')
             ->filters([
@@ -99,9 +95,9 @@ class CustomerResource extends Resource
     {
         return [
             'index' => Pages\ManageCustomers::route('/'),
-//            'index' => Pages\ListCustomers::route('/'),
-//            'create' => Pages\CreateCustomer::route('/create'),
-//            'edit' => Pages\EditCustomer::route('/{record}/edit'),
+            //            'index' => Pages\ListCustomers::route('/'),
+            //            'create' => Pages\CreateCustomer::route('/create'),
+            //            'edit' => Pages\EditCustomer::route('/{record}/edit'),
         ];
     }
 }

+ 0 - 1
web/app/Filament/Resources/CustomerResource/Pages/CreateCustomer.php

@@ -3,7 +3,6 @@
 namespace App\Filament\Resources\CustomerResource\Pages;
 
 use App\Filament\Resources\CustomerResource;
-use Filament\Actions;
 use Filament\Resources\Pages\CreateRecord;
 
 class CreateCustomer extends CreateRecord

+ 1 - 1
web/app/Filament/Resources/CustomerResource/Pages/EditCustomer.php

@@ -25,7 +25,7 @@ class EditCustomer extends EditRecord
                             ->send();
                         $action->cancel();
                     }
-                })
+                }),
         ];
     }
 }

+ 0 - 1
web/app/Filament/Resources/CustomerResource/Pages/ManageCustomers.php

@@ -2,7 +2,6 @@
 
 namespace App\Filament\Resources\CustomerResource\Pages;
 
-
 use App\Filament\Resources\CustomerResource;
 use Filament\Actions;
 use Filament\Resources\Pages\ManageRecords;

+ 10 - 16
web/app/Filament/Resources/DomainResource.php

@@ -3,16 +3,11 @@
 namespace App\Filament\Resources;
 
 use App\Filament\Resources\DomainResource\Pages;
-use App\Filament\Resources\DomainResource\RelationManagers;
 use App\Models\Domain;
-use Filament\Forms;
 use Filament\Forms\Form;
 use Filament\Resources\Resource;
 use Filament\Tables;
 use Filament\Tables\Table;
-use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\SoftDeletingScope;
-use Illuminate\Support\Str;
 
 class DomainResource extends Resource
 {
@@ -29,7 +24,6 @@ class DomainResource extends Resource
         return $form
             ->schema([
 
-
             ]);
     }
 
@@ -41,13 +35,13 @@ class DomainResource extends Resource
                     ->searchable()
                     ->sortable(),
 
-//                Tables\Columns\TextColumn::make('hostingPlan.name')
-//                    ->searchable()
-//                    ->sortable(),
+                //                Tables\Columns\TextColumn::make('hostingPlan.name')
+                //                    ->searchable()
+                //                    ->sortable(),
 
-//                Tables\Columns\TextColumn::make('customer.name')
-//                    ->searchable()
-//                    ->sortable(),
+                //                Tables\Columns\TextColumn::make('customer.name')
+                //                    ->searchable()
+                //                    ->sortable(),
 
             ])
             ->defaultSort('id', 'desc')
@@ -59,11 +53,11 @@ class DomainResource extends Resource
                     ->label('Open website')
                     ->icon('heroicon-m-arrow-top-right-on-square')
                     ->color('gray')
-                    ->url(fn ($record): string => 'http://' . $record->domain, true),
+                    ->url(fn ($record): string => 'http://'.$record->domain, true),
             ])
             ->bulkActions([
                 Tables\Actions\BulkActionGroup::make([
-                  //  Tables\Actions\DeleteBulkAction::make(),
+                    //  Tables\Actions\DeleteBulkAction::make(),
                 ]),
             ]);
     }
@@ -79,8 +73,8 @@ class DomainResource extends Resource
     {
         return [
             'index' => Pages\ListWebsites::route('/'),
-          //  'create' => Pages\CreateWebsite::route('/create'),
-//            'edit' => Pages\EditWebsite::route('/{record}/edit'),
+            //  'create' => Pages\CreateWebsite::route('/create'),
+            //            'edit' => Pages\EditWebsite::route('/{record}/edit'),
             'view' => Pages\ViewWebsite::route('/{record}'),
         ];
     }

+ 0 - 1
web/app/Filament/Resources/DomainResource/Pages/CreateWebsite.php

@@ -3,7 +3,6 @@
 namespace App\Filament\Resources\DomainResource\Pages;
 
 use App\Filament\Resources\DomainResource;
-use Filament\Actions;
 use Filament\Resources\Pages\CreateRecord;
 
 class CreateWebsite extends CreateRecord

+ 1 - 1
web/app/Filament/Resources/DomainResource/Pages/EditWebsite.php

@@ -13,7 +13,7 @@ class EditWebsite extends EditRecord
     protected function getHeaderActions(): array
     {
         return [
-        //    Actions\DeleteAction::make(),
+            //    Actions\DeleteAction::make(),
         ];
     }
 }

+ 0 - 2
web/app/Filament/Resources/DomainResource/Pages/ViewWebsite.php

@@ -3,7 +3,6 @@
 namespace App\Filament\Resources\DomainResource\Pages;
 
 use App\Filament\Resources\DomainResource;
-use Filament\Actions;
 use Filament\Resources\Pages\ViewRecord;
 
 class ViewWebsite extends ViewRecord
@@ -11,5 +10,4 @@ class ViewWebsite extends ViewRecord
     protected static string $resource = DomainResource::class;
 
     protected static string $view = 'filament.resources.website.pages.view-website';
-
 }

+ 1 - 5
web/app/Filament/Resources/HostingPlanResource.php

@@ -3,15 +3,12 @@
 namespace App\Filament\Resources;
 
 use App\Filament\Resources\HostingPlanResource\Pages;
-use App\Filament\Resources\HostingPlanResource\RelationManagers;
 use App\Models\HostingPlan;
 use Filament\Forms;
 use Filament\Forms\Form;
 use Filament\Resources\Resource;
 use Filament\Tables;
 use Filament\Tables\Table;
-use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\SoftDeletingScope;
 
 class HostingPlanResource extends Resource
 {
@@ -108,11 +105,10 @@ class HostingPlanResource extends Resource
                     ->label('Features')
                     ->options([
                         'ssl' => 'SSL',
-                        'backup' => 'Backup'
+                        'backup' => 'Backup',
                     ])
                     ->multiple(),
 
-
             ]);
     }
 

+ 0 - 1
web/app/Filament/Resources/HostingPlanResource/Pages/CreateHostingPlan.php

@@ -3,7 +3,6 @@
 namespace App\Filament\Resources\HostingPlanResource\Pages;
 
 use App\Filament\Resources\HostingPlanResource;
-use Filament\Actions;
 use Filament\Resources\Pages\CreateRecord;
 
 class CreateHostingPlan extends CreateRecord

+ 21 - 25
web/app/Filament/Resources/HostingSubscriptionResource.php

@@ -3,16 +3,12 @@
 namespace App\Filament\Resources;
 
 use App\Filament\Resources\HostingSubscriptionResource\Pages;
-use App\Filament\Resources\HostingSubscriptionResource\RelationManagers;
 use App\Models\HostingSubscription;
 use Filament\Forms;
-use Filament\Forms\Components\Field;
 use Filament\Forms\Form;
 use Filament\Resources\Resource;
 use Filament\Tables;
 use Filament\Tables\Table;
-use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\SoftDeletingScope;
 use Illuminate\Support\HtmlString;
 
 class HostingSubscriptionResource extends Resource
@@ -41,8 +37,8 @@ class HostingSubscriptionResource extends Resource
                         }
                     })
                     ->content(fn ($record) => new HtmlString('
-                    <a href="http://' . $record->domain . '" target="_blank" class="text-sm font-medium text-primary-600 dark:text-primary-400">
-                           http://' . $record->domain . '
+                    <a href="http://'.$record->domain.'" target="_blank" class="text-sm font-medium text-primary-600 dark:text-primary-400">
+                           http://'.$record->domain.'
                     </a>')),
 
                 Forms\Components\TextInput::make('domain')
@@ -56,7 +52,7 @@ class HostingSubscriptionResource extends Resource
                         }
                     })
                     ->suffixIcon('heroicon-m-globe-alt')
-                ->columnSpanFull(),
+                    ->columnSpanFull(),
 
                 Forms\Components\Select::make('customer_id')
                     ->label('Customer')
@@ -94,20 +90,20 @@ class HostingSubscriptionResource extends Resource
                     })
                     ->suffixIcon('heroicon-m-user'),
 
-                    Forms\Components\TextInput::make('system_password')
-                        ->hidden(fn (Forms\Get $get): bool => ! $get('advanced'))
-                        ->disabled(function ($record) {
-                            if (isset($record->exists)) {
-                                return $record->exists;
-                            } else {
-                                return false;
-                            }
-                        })
-                        ->suffixIcon('heroicon-m-lock-closed'),
-
-                    Forms\Components\Textarea::make('description')
-                        ->hidden(fn (Forms\Get $get): bool => ! $get('advanced'))
-                        ->columnSpanFull(),
+                Forms\Components\TextInput::make('system_password')
+                    ->hidden(fn (Forms\Get $get): bool => ! $get('advanced'))
+                    ->disabled(function ($record) {
+                        if (isset($record->exists)) {
+                            return $record->exists;
+                        } else {
+                            return false;
+                        }
+                    })
+                    ->suffixIcon('heroicon-m-lock-closed'),
+
+                Forms\Components\Textarea::make('description')
+                    ->hidden(fn (Forms\Get $get): bool => ! $get('advanced'))
+                    ->columnSpanFull(),
 
             ]);
     }
@@ -143,7 +139,7 @@ class HostingSubscriptionResource extends Resource
                     ->label('Open website')
                     ->icon('heroicon-m-arrow-top-right-on-square')
                     ->color('gray')
-                    ->url(fn ($record): string => 'http://' . $record->domain, true),
+                    ->url(fn ($record): string => 'http://'.$record->domain, true),
                 Tables\Actions\EditAction::make(),
                 Tables\Actions\DeleteAction::make(),
             ])
@@ -165,9 +161,9 @@ class HostingSubscriptionResource extends Resource
     {
         return [
             'index' => Pages\ManageHostingSubscriptions::route('/'),
-//            'index' => Pages\ListHostingSubscriptions::route('/'),
-//            'create' => Pages\CreateHostingSubscription::route('/create'),
-//            'edit' => Pages\EditHostingSubscription::route('/{record}/edit'),
+            //            'index' => Pages\ListHostingSubscriptions::route('/'),
+            //            'create' => Pages\CreateHostingSubscription::route('/create'),
+            //            'edit' => Pages\EditHostingSubscription::route('/{record}/edit'),
         ];
     }
 }

+ 0 - 2
web/app/Filament/Resources/HostingSubscriptionResource/Pages/CreateHostingSubscription.php

@@ -3,11 +3,9 @@
 namespace App\Filament\Resources\HostingSubscriptionResource\Pages;
 
 use App\Filament\Resources\HostingSubscriptionResource;
-use Filament\Actions;
 use Filament\Resources\Pages\CreateRecord;
 
 class CreateHostingSubscription extends CreateRecord
 {
     protected static string $resource = HostingSubscriptionResource::class;
-
 }

+ 0 - 1
web/app/Filament/Resources/HostingSubscriptionResource/Pages/ManageHostingSubscriptions.php

@@ -2,7 +2,6 @@
 
 namespace App\Filament\Resources\HostingSubscriptionResource\Pages;
 
-
 use App\Filament\Resources\HostingSubscriptionResource;
 use Filament\Actions;
 use Filament\Resources\Pages\ManageRecords;

+ 0 - 3
web/app/Filament/Resources/UserResource.php

@@ -3,15 +3,12 @@
 namespace App\Filament\Resources;
 
 use App\Filament\Resources\UserResource\Pages;
-use App\Filament\Resources\UserResource\RelationManagers;
 use App\Models\User;
 use Filament\Forms;
 use Filament\Forms\Form;
 use Filament\Resources\Resource;
 use Filament\Tables;
 use Filament\Tables\Table;
-use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\SoftDeletingScope;
 
 class UserResource extends Resource
 {

+ 0 - 1
web/app/Filament/Resources/UserResource/Pages/CreateUser.php

@@ -3,7 +3,6 @@
 namespace App\Filament\Resources\UserResource\Pages;
 
 use App\Filament\Resources\UserResource;
-use Filament\Actions;
 use Filament\Resources\Pages\CreateRecord;
 
 class CreateUser extends CreateRecord

+ 9 - 11
web/app/Filament/Widgets/CustomersCount.php

@@ -16,22 +16,20 @@ class CustomersCount extends BaseWidget
     protected function getStats(): array
     {
 
-//        $serverStatistic = new \App\Statistics\ServerStatistic();
-//        $serverStats = $serverStatistic->getCurrentStats();
-
+        //        $serverStatistic = new \App\Statistics\ServerStatistic();
+        //        $serverStats = $serverStatistic->getCurrentStats();
 
         $customersCount = Customer::count();
         $websiteCount = Domain::count();
 
         return [
-//            Stat::make('Total Memory', $serverStats['memory']['total']),
-//            Stat::make('Used Memory', $serverStats['memory']['used']),
-//            Stat::make('Free Memory', $serverStats['memory']['free']),
-//            Stat::make('Shared Memory', $serverStats['memory']['shared']),
-//            Stat::make('Buffer Cache', $serverStats['memory']['buffCache']),
-//            Stat::make('Available Memory', $serverStats['memory']['available']),
-//
-
+            //            Stat::make('Total Memory', $serverStats['memory']['total']),
+            //            Stat::make('Used Memory', $serverStats['memory']['used']),
+            //            Stat::make('Free Memory', $serverStats['memory']['free']),
+            //            Stat::make('Shared Memory', $serverStats['memory']['shared']),
+            //            Stat::make('Buffer Cache', $serverStats['memory']['buffCache']),
+            //            Stat::make('Available Memory', $serverStats['memory']['available']),
+            //
 
             Stat::make('Websites', $websiteCount)->icon('heroicon-o-globe-alt'),
             Stat::make('Customers', $customersCount)->icon('heroicon-o-users'),

+ 0 - 7
web/app/Filament/Widgets/ServerDiskUsageStatistic.php

@@ -8,27 +8,21 @@ class ServerDiskUsageStatistic extends ApexChartWidget
 {
     /**
      * Chart Id
-     *
-     * @var string
      */
     protected static ?string $chartId = 'serverDiskUsageStatisticChart';
 
     /**
      * Widget Title
-     *
-     * @var string|null
      */
     protected static ?string $heading = 'Disk Usage';
 
     protected static ?int $sort = 1;
 
-
     /**
      * Widget content height
      */
     protected static ?int $contentHeight = 100;
 
-
     /**
      * Widget Footer
      */
@@ -40,7 +34,6 @@ class ServerDiskUsageStatistic extends ApexChartWidget
         return view('charts.order-status.footer', ['data' => $serverStats]);
     }
 
-
     /**
      * Chart options (series, labels, types, size, animations...)
      * https://apexcharts.com/docs/options

+ 0 - 7
web/app/Filament/Widgets/ServerMemoryStatistic.php

@@ -8,27 +8,21 @@ class ServerMemoryStatistic extends ApexChartWidget
 {
     /**
      * Chart Id
-     *
-     * @var string
      */
     protected static ?string $chartId = 'serverMemoryStatisticChart';
 
     /**
      * Widget Title
-     *
-     * @var string|null
      */
     protected static ?string $heading = 'RAM Usage';
 
     protected static ?int $sort = 2;
 
-
     /**
      * Widget content height
      */
     protected static ?int $contentHeight = 100;
 
-
     /**
      * Widget Footer
      */
@@ -40,7 +34,6 @@ class ServerMemoryStatistic extends ApexChartWidget
         return view('filament.widgets.server-memory-statistic', ['data' => $serverStats]);
     }
 
-
     /**
      * Chart options (series, labels, types, size, animations...)
      * https://apexcharts.com/docs/options

+ 0 - 3
web/app/Filament/Widgets/ServerMemoryStatisticCount.php

@@ -2,10 +2,7 @@
 
 namespace App\Filament\Widgets;
 
-use App\Models\Customer;
-use App\Models\Domain;
 use Filament\Widgets\StatsOverviewWidget as BaseWidget;
-use Filament\Widgets\StatsOverviewWidget\Stat;
 
 class ServerMemoryStatisticCount extends BaseWidget
 {

+ 4 - 5
web/app/Filament/Widgets/Websites.php

@@ -3,7 +3,6 @@
 namespace App\Filament\Widgets;
 
 use App\Models\Domain;
-use Faker\Provider\Text;
 use Filament\Tables;
 use Filament\Tables\Table;
 use Filament\Widgets\TableWidget as BaseWidget;
@@ -14,9 +13,9 @@ class Websites extends BaseWidget
 
     protected static ?string $heading = 'Last created websites';
 
-    protected int | string | array $columnSpan = 2;
+    protected int|string|array $columnSpan = 2;
 
-    protected static ?int $sort =5;
+    protected static ?int $sort = 5;
 
     public function table(Table $table): Table
     {
@@ -29,12 +28,12 @@ class Websites extends BaseWidget
                     ->label('Open website')
                     ->icon('heroicon-m-arrow-top-right-on-square')
                     ->color('gray')
-                    ->url(fn ($record): string => 'http://' . $record->domain, true),
+                    ->url(fn ($record): string => 'http://'.$record->domain, true),
             ])
             ->columns([
                 Tables\Columns\TextColumn::make('domain'),
                 Tables\Columns\TextColumn::make('hostingPlan.name'),
-                Tables\Columns\TextColumn::make('created_at')
+                Tables\Columns\TextColumn::make('created_at'),
             ])->defaultSort('id', 'desc');
     }
 }

+ 2 - 2
web/app/FileManagerApi.php

@@ -13,6 +13,7 @@ class FileManagerApi
     {
         return is_file($path);
     }
+
     public function isWritable($path)
     {
         return is_writable($path);
@@ -37,10 +38,9 @@ class FileManagerApi
     {
         return file_exists($file);
     }
+
     public function filePutContents($file, $data)
     {
         return file_put_contents($file, $data);
     }
-
-
 }

+ 11 - 5
web/app/Http/Controllers/Api/CustomersController.php

@@ -6,17 +6,18 @@ use App\Http\Controllers\Api\Request\CustomerCreateRequest;
 use App\Http\Controllers\ApiController;
 use App\Models\Customer;
 use App\Models\HostingSubscription;
-use Illuminate\Http\Request;
 
 class CustomersController extends ApiController
 {
     /**
      * @OA\Get(
      *      path="/api/customers",
+     *
      *      @OA\Response(
      *          response=200,
      *          description="Successful operation",
      *      ),
+     *
      *     @OA\PathItem (
      *     ),
      * )
@@ -30,7 +31,7 @@ class CustomersController extends ApiController
             'message' => 'Customers found',
             'data' => [
                 'customers' => $findCustomers,
-            ]
+            ],
         ]);
 
     }
@@ -38,16 +39,21 @@ class CustomersController extends ApiController
     /**
      * @OA\Post(
      *      path="/api/customers",
+     *
      *      @OA\Response(
      *          response=200,
      *          description="Successful operation",
      *      ),
+     *
      *     @OA\PathItem (
      *     ),
+     *
      *     @OA\RequestBody(
      *     required=true,
+     *
      *     @OA\JsonContent(
      *     required={"name","email","phone"},
+     *
      *     @OA\Property(property="name", type="string", example="John Doe", description="Name of the customer"),
      *     @OA\Property(property="email", type="string", example="jhon@gmail.com", description="Email of the customer"),
      *     @OA\Property(property="phone", type="string", example="1234567890", description="Phone of the customer")
@@ -67,14 +73,14 @@ class CustomersController extends ApiController
             'message' => 'Customer created',
             'data' => [
                 'customer' => $customer,
-            ]
+            ],
         ]);
     }
 
     public function getHostingSubscriptionsByCustomerId($customerId)
     {
         $findCustomer = Customer::where('id', $customerId)->first();
-        if (!$findCustomer) {
+        if (! $findCustomer) {
             return response()->json([
                 'status' => 'error',
                 'message' => 'Customer not found',
@@ -94,7 +100,7 @@ class CustomersController extends ApiController
             'message' => 'Hosting subscriptions found',
             'data' => [
                 'hostingSubscriptions' => $findHostingSubscriptions,
-            ]
+            ],
         ]);
     }
 }

+ 3 - 3
web/app/Http/Controllers/Api/HealthController.php

@@ -2,19 +2,19 @@
 
 namespace App\Http\Controllers\Api;
 
-
 use App\Http\Controllers\ApiController;
-use App\ShellApi;
 
 class HealthController extends ApiController
 {
     /**
      * @OA\Get(
      *      path="/api/health",
+     *
      *      @OA\Response(
      *          response=200,
      *          description="Successful operation",
      *      ),
+     *
      *     @OA\PathItem (
      *     ),
      * )
@@ -23,7 +23,7 @@ class HealthController extends ApiController
     {
         return response()->json([
             'status' => 'ok',
-            'message' => 'API is running.'
+            'message' => 'API is running.',
         ]);
 
     }

+ 10 - 4
web/app/Http/Controllers/Api/HostingPlansController.php

@@ -6,17 +6,18 @@ use App\Http\Controllers\Api\Request\CustomerCreateRequest;
 use App\Http\Controllers\ApiController;
 use App\Models\Customer;
 use App\Models\HostingPlan;
-use Illuminate\Http\Request;
 
 class HostingPlansController extends ApiController
 {
     /**
      * @OA\Get(
      *      path="/api/hosting-plans",
+     *
      *      @OA\Response(
      *          response=200,
      *          description="Successful operation",
      *      ),
+     *
      *     @OA\PathItem (
      *     ),
      * )
@@ -29,8 +30,8 @@ class HostingPlansController extends ApiController
             'status' => 'ok',
             'message' => 'Hosting Plans found',
             'data' => [
-                'hostingPlans' => $findHostingPlans->toArray()
-            ]
+                'hostingPlans' => $findHostingPlans->toArray(),
+            ],
         ]);
 
     }
@@ -38,16 +39,21 @@ class HostingPlansController extends ApiController
     /**
      * @OA\Post(
      *      path="/api/customers",
+     *
      *      @OA\Response(
      *          response=200,
      *          description="Successful operation",
      *      ),
+     *
      *     @OA\PathItem (
      *     ),
+     *
      *     @OA\RequestBody(
      *     required=true,
+     *
      *     @OA\JsonContent(
      *     required={"name","email","phone"},
+     *
      *     @OA\Property(property="name", type="string", example="John Doe", description="Name of the customer"),
      *     @OA\Property(property="email", type="string", example="jhon@gmail.com", description="Email of the customer"),
      *     @OA\Property(property="phone", type="string", example="1234567890", description="Phone of the customer")
@@ -68,7 +74,7 @@ class HostingPlansController extends ApiController
             'message' => 'Customer created',
             'data' => [
                 'customer' => $customer,
-            ]
+            ],
         ]);
     }
 }

+ 6 - 5
web/app/Http/Controllers/Api/HostingSubscriptionsController.php

@@ -18,7 +18,7 @@ class HostingSubscriptionsController extends ApiController
             'message' => 'Hosting subscriptions found',
             'data' => [
                 'HostingSubscriptions' => $findHostingSubscription,
-            ]
+            ],
         ]);
 
     }
@@ -29,9 +29,9 @@ class HostingSubscriptionsController extends ApiController
         $hostingSubscription->customer_id = $request->customer_id;
         $hostingSubscription->hosting_plan_id = $request->hosting_plan_id;
         $hostingSubscription->domain = $request->domain;
-//        $hostingSubscription->username = $request->username;
-//        $hostingSubscription->password = $request->password;
-//        $hostingSubscription->description = $request->description;
+        //        $hostingSubscription->username = $request->username;
+        //        $hostingSubscription->password = $request->password;
+        //        $hostingSubscription->description = $request->description;
         $hostingSubscription->setup_date = Carbon::now();
         $hostingSubscription->save();
 
@@ -40,7 +40,7 @@ class HostingSubscriptionsController extends ApiController
             'message' => 'Hosting subscription created',
             'data' => [
                 'hostingSubscription' => $hostingSubscription,
-            ]
+            ],
         ]);
     }
 
@@ -49,6 +49,7 @@ class HostingSubscriptionsController extends ApiController
         $findHostingSubscription = HostingSubscription::where('id', $id)->first();
         if ($findHostingSubscription) {
             $findHostingSubscription->delete();
+
             return response()->json([
                 'status' => 'ok',
                 'message' => 'Hosting subscription deleted',

+ 1 - 1
web/app/Http/Controllers/Api/Request/AuthLoginRequest.php

@@ -14,7 +14,7 @@ class AuthLoginRequest extends ApiRequest
         return [
             'email' => 'required|string|email',
             'password' => 'required|string',
-        //    'browserAgent' => 'required|string',
+            //    'browserAgent' => 'required|string',
         ];
     }
 }

+ 2 - 1
web/app/Http/Controllers/Api/Request/CustomerCreateRequest.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace App\Http\Controllers\Api\Request;
 
 class CustomerCreateRequest extends AuthorizedApiRequest
@@ -12,7 +13,7 @@ class CustomerCreateRequest extends AuthorizedApiRequest
     {
         return [
             'name' => 'required',
-            'email' => 'required|email|unique:customers,email'
+            'email' => 'required|email|unique:customers,email',
         ];
     }
 }

+ 2 - 3
web/app/Http/Controllers/ApiController.php

@@ -10,6 +10,7 @@ use Illuminate\Routing\Controller as BaseController;
  * @OA\Info(
  *     title="PhyrePanel - API Documentation",
  *     version="0.1",
+ *
  *      @OA\Contact(
  *          email="info@phyrepanel.com"
  *      ),
@@ -17,8 +18,6 @@ use Illuminate\Routing\Controller as BaseController;
  */
 class ApiController extends BaseController
 {
-  //  use AuthorizesRequests, ValidatesRequests;
+    //  use AuthorizesRequests, ValidatesRequests;
     use ValidatesRequests;
-
-
 }

+ 5 - 12
web/app/Listeners/ModelDomainCreatedListener.php

@@ -5,16 +5,9 @@ namespace App\Listeners;
 use App\Actions\ApacheWebsiteCreate;
 use App\Events\DomainIsCreated;
 use App\Events\ModelDomainCreated;
-use App\Models\Customer;
 use App\Models\Domain;
-use App\Models\HostingPackage;
 use App\Models\HostingPlan;
 use App\Models\HostingSubscription;
-use Cassandra\Custom;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Queue\InteractsWithQueue;
-use Illuminate\Support\Str;
-use function Symfony\Component\String\u;
 
 class ModelDomainCreatedListener
 {
@@ -32,16 +25,16 @@ class ModelDomainCreatedListener
     public function handle(ModelDomainCreated $event): void
     {
         $findDomain = Domain::where('id', $event->model->id)->first();
-        if (!$findDomain) {
+        if (! $findDomain) {
             return;
         }
         $findHostingSubscription = HostingSubscription::where('id', $findDomain->hosting_subscription_id)->first();
-        if (!$findHostingSubscription) {
+        if (! $findHostingSubscription) {
             return;
         }
 
         $findHostingPlan = HostingPlan::where('id', $findHostingSubscription->hosting_plan_id)->first();
-        if (!$findHostingPlan) {
+        if (! $findHostingPlan) {
             return;
         }
 
@@ -54,9 +47,9 @@ class ModelDomainCreatedListener
             $newApacheWebsite->setIsMainDomain(true);
         }
 
-       $create = $newApacheWebsite->handle();
+        $create = $newApacheWebsite->handle();
 
-        if (!empty($create)) {
+        if (! empty($create)) {
 
             $findDomain->home_root = $create['homeRoot'];
             $findDomain->domain_root = $create['domainRoot'];

+ 1 - 3
web/app/Listeners/ModelDomainDeletingListener.php

@@ -5,8 +5,6 @@ namespace App\Listeners;
 use App\Actions\ApacheWebsiteDelete;
 use App\Events\ModelDomainDeleting;
 use App\ShellApi;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Queue\InteractsWithQueue;
 
 class ModelDomainDeletingListener
 {
@@ -25,7 +23,7 @@ class ModelDomainDeletingListener
     {
         $domainRoot = '/home/'.$event->model->domain_username.'/domains/'.$event->model->domain;
 
-        ShellApi::exec('rm -rf ' . $domainRoot);
+        ShellApi::exec('rm -rf '.$domainRoot);
 
         $deleteApacheWebsite = new ApacheWebsiteDelete();
         $deleteApacheWebsite->setDomain($event->model->domain);

+ 7 - 7
web/app/Listeners/ModelHostingSubscriptionCreatedListener.php

@@ -27,24 +27,24 @@ class ModelHostingSubscriptionCreatedListener
     {
 
         $findHostingSubscription = HostingSubscription::where('id', $event->model->id)->first();
-        if (!$findHostingSubscription) {
+        if (! $findHostingSubscription) {
             return;
         }
         $findCustomer = Customer::where('id', $event->model->customer_id)->first();
-        if (!$findCustomer) {
+        if (! $findCustomer) {
             return;
         }
 
         $systemUsername = $this->_generateUsername($event->model->domain);
-        $systemUsername = $systemUsername . $findCustomer->id . $findHostingSubscription->id;
+        $systemUsername = $systemUsername.$findCustomer->id.$findHostingSubscription->id;
 
         $getLinuxUser = new GetLinuxUser();
         $getLinuxUser->setUsername($systemUsername);
         $linuxUser = $getLinuxUser->handle();
 
-        if (!empty($linuxUser)) {
+        if (! empty($linuxUser)) {
             $systemUsername = $this->_generateUsername(Str::random(10));
-            $systemUsername = $systemUsername . $findCustomer->id . $findHostingSubscription->id;
+            $systemUsername = $systemUsername.$findCustomer->id.$findHostingSubscription->id;
         }
 
         $systemPassword = Str::random(14);
@@ -75,13 +75,13 @@ class ModelHostingSubscriptionCreatedListener
         $removedMultispace = preg_replace('/\s+/', ' ', $string);
         $sanitized = preg_replace('/[^A-Za-z0-9\ ]/', '', $removedMultispace);
         $lowercased = strtolower($sanitized);
-        $lowercased = str_replace(" ", "", $lowercased);
+        $lowercased = str_replace(' ', '', $lowercased);
         $lowercased = trim($lowercased);
         if (strlen($lowercased) > 10) {
             $lowercased = substr($lowercased, 0, 10);
         }
 
-        $username = $lowercased . rand(1111,9999) . Str::random(4);
+        $username = $lowercased.rand(1111, 9999).Str::random(4);
         $username = strtolower($username);
 
         return $username;

+ 3 - 5
web/app/Listeners/ModelHostingSubscriptionDeletingListener.php

@@ -3,7 +3,6 @@
 namespace App\Listeners;
 
 use App\Actions\GetLinuxUser;
-use App\Events\ModelHostingSubscriptionCreated;
 use App\Events\ModelHostingSubscriptionDeleting;
 use App\Models\Domain;
 
@@ -26,9 +25,9 @@ class ModelHostingSubscriptionDeletingListener
         $getLinuxUser->setUsername($event->model->system_username);
         $getLinuxUserStatus = $getLinuxUser->handle();
 
-        if (!empty($getLinuxUserStatus)) {
-            shell_exec('userdel ' . $event->model->system_username);
-            shell_exec('rm -rf /home/' . $event->model->system_username);
+        if (! empty($getLinuxUserStatus)) {
+            shell_exec('userdel '.$event->model->system_username);
+            shell_exec('rm -rf /home/'.$event->model->system_username);
         }
         $findRelatedDomains = Domain::where('hosting_subscription_id', $event->model->id)->get();
         if ($findRelatedDomains->count() > 0) {
@@ -38,5 +37,4 @@ class ModelHostingSubscriptionDeletingListener
         }
 
     }
-
 }

+ 3 - 1
web/app/Livewire/Installer.php

@@ -3,7 +3,6 @@
 namespace App\Livewire;
 
 use App\Models\User;
-use Illuminate\Support\Facades\Artisan;
 use Livewire\Component;
 
 class Installer extends Component
@@ -11,8 +10,11 @@ class Installer extends Component
     public $step = 1;
 
     public $name;
+
     public $email;
+
     public $password;
+
     public $password_confirmation;
 
     public function install()

+ 0 - 1
web/app/Models/Backup.php

@@ -2,7 +2,6 @@
 
 namespace App\Models;
 
-use Illuminate\Database\Eloquent\Factories\HasFactory;
 use Illuminate\Database\Eloquent\Model;
 use Sushi\Sushi;
 

+ 4 - 5
web/app/Models/CronJob.php

@@ -3,7 +3,6 @@
 namespace App\Models;
 
 use App\ShellApi;
-use Illuminate\Database\Eloquent\Factories\HasFactory;
 use Illuminate\Database\Eloquent\Model;
 use Sushi\Sushi;
 
@@ -64,20 +63,20 @@ class CronJob extends Model
         $user = ShellApi::exec('whoami');
 
         $cronList = ShellApi::callBin('cron-jobs-list', [
-            $user
+            $user,
         ]);
 
         $rows = [];
-        if (!empty($cronList)) {
+        if (! empty($cronList)) {
             $cronList = json_decode($cronList, true);
-            if (!empty($cronList)) {
+            if (! empty($cronList)) {
                 foreach ($cronList as $cron) {
                     if (isset($cron['schedule'])) {
                         $rows[] = [
                             'schedule' => $cron['schedule'],
                             'command' => $cron['command'],
                             'user' => $user,
-                            'time'=> time(),
+                            'time' => time(),
                         ];
                     }
                 }

+ 0 - 2
web/app/Models/Customer.php

@@ -5,7 +5,6 @@ namespace App\Models;
 use Illuminate\Database\Eloquent\Factories\HasFactory;
 use Illuminate\Database\Eloquent\Model;
 
-
 class Customer extends Model
 {
     use HasFactory;
@@ -28,5 +27,4 @@ class Customer extends Model
     {
         return $this->hasMany(HostingSubscription::class);
     }
-
 }

+ 0 - 3
web/app/Models/Domain.php

@@ -4,8 +4,6 @@ namespace App\Models;
 
 use App\Events\ModelDomainCreated;
 use App\Events\ModelDomainDeleting;
-use App\ShellApi;
-use Illuminate\Database\Eloquent\Factories\HasFactory;
 use Illuminate\Database\Eloquent\Model;
 
 class Domain extends Model
@@ -30,5 +28,4 @@ class Domain extends Model
         });
 
     }
-
 }

+ 0 - 1
web/app/Models/DomainSslCertificate.php

@@ -23,5 +23,4 @@ class DomainSslCertificate extends Model
         'renewed_date',
         'renewed_until_date',
     ];
-
 }

+ 2 - 3
web/app/Models/HostingDatabase.php

@@ -10,7 +10,7 @@ class HostingDatabase extends Model
     protected $fillable = [
         'database_name',
         'database_username',
-        'database_password'
+        'database_password',
     ];
 
     public static function boot()
@@ -22,7 +22,7 @@ class HostingDatabase extends Model
             $createDbAndUser = ShellApi::callBin('mysql-create-db-and-user', [
                 $model->database_name,
                 $model->database_username,
-                $model->database_password
+                $model->database_password,
             ]);
 
             if (empty($createDbAndUser)) {
@@ -35,5 +35,4 @@ class HostingDatabase extends Model
 
         });
     }
-
 }

+ 0 - 1
web/app/Models/HostingPlan.php

@@ -34,5 +34,4 @@ class HostingPlan extends Model
         'features' => 'array',
         'limitations' => 'array',
     ];
-
 }

+ 1 - 2
web/app/Models/HostingSubscription.php

@@ -18,7 +18,7 @@ class HostingSubscription extends Model
         'description',
         'setup_date',
         'expiry_date',
-        'renewal_date'
+        'renewal_date',
     ];
 
     public static function boot()
@@ -44,5 +44,4 @@ class HostingSubscription extends Model
     {
         return $this->belongsTo(HostingPlan::class);
     }
-
 }

+ 1 - 1
web/app/Models/User.php

@@ -11,7 +11,7 @@ use Rappasoft\LaravelAuthenticationLog\Traits\AuthenticationLoggable;
 
 class User extends Authenticatable
 {
-    use HasApiTokens, HasFactory, Notifiable, AuthenticationLoggable;
+    use AuthenticationLoggable, HasApiTokens, HasFactory, Notifiable;
 
     /**
      * The attributes that are mass assignable.

+ 2 - 3
web/app/PhyreLaravelApplication.php

@@ -8,7 +8,6 @@ use Illuminate\Foundation\Application;
  * @property \App\FileManagerApi $file_manager_api
  * @property \App\VirtualHosts\ApacheVirtualHostManager $virtualHostManager
  */
-class PhyreLaravelApplication extends Application {
-
+class PhyreLaravelApplication extends Application
+{
 }
-

+ 10 - 8
web/app/Policies/CustomerPolicy.php

@@ -3,8 +3,8 @@
 namespace App\Policies;
 
 use App\Models\Customer;
-use App\Models\User;
 use App\Models\Domain;
+use App\Models\User;
 use Illuminate\Auth\Access\Response;
 
 class CustomerPolicy
@@ -12,7 +12,7 @@ class CustomerPolicy
     /**
      * Determine whether the user can view any models.
      */
-    public function viewAny(User $user)  : bool
+    public function viewAny(User $user): bool
     {
         return true;
     }
@@ -20,7 +20,7 @@ class CustomerPolicy
     /**
      * Determine whether the user can view the model.
      */
-    public function view(User $user, Customer $customer)  : bool
+    public function view(User $user, Customer $customer): bool
     {
         return true;
     }
@@ -28,7 +28,7 @@ class CustomerPolicy
     /**
      * Determine whether the user can create models.
      */
-    public function create(User $user)  : bool
+    public function create(User $user): bool
     {
         return true;
     }
@@ -36,7 +36,7 @@ class CustomerPolicy
     /**
      * Determine whether the user can update the model.
      */
-    public function update(User $user, Customer $customer)  : bool
+    public function update(User $user, Customer $customer): bool
     {
         return true;
     }
@@ -44,7 +44,7 @@ class CustomerPolicy
     /**
      * Determine whether the user can delete the model.
      */
-    public function delete(User $user, Customer $customer) : bool
+    public function delete(User $user, Customer $customer): bool
     {
         return true;
     }
@@ -52,7 +52,7 @@ class CustomerPolicy
     /**
      * Determine whether the user can restore the model.
      */
-    public function restore(User $user, Customer $customer)  : bool
+    public function restore(User $user, Customer $customer): bool
     {
         return true;
     }
@@ -60,13 +60,15 @@ class CustomerPolicy
     /**
      * Determine whether the user can permanently delete the model.
      */
-    public function forceDelete(User $user, Customer $customer) : bool
+    public function forceDelete(User $user, Customer $customer): bool
     {
         $findWebsites = Domain::where('customer_id', $customer->id)->count();
         if ($findWebsites > 0) {
             Response::deny('Customer has websites, please delete them first.');
+
             return false;
         }
+
         return true;
     }
 }

+ 8 - 12
web/app/Providers/AppServiceProvider.php

@@ -2,18 +2,14 @@
 
 namespace App\Providers;
 
-
-use App\Events\ModelHostingSubscriptionCreated;
-use App\Events\ModelHostingSubscriptionDeleting;
-
-use App\Listeners\ModelHostingSubscriptionCreatedListener;
-use App\Listeners\ModelHostingSubscriptionDeletingListener;
-
 use App\Events\ModelDomainCreated;
 use App\Events\ModelDomainDeleting;
+use App\Events\ModelHostingSubscriptionCreated;
+use App\Events\ModelHostingSubscriptionDeleting;
 use App\Listeners\ModelDomainCreatedListener;
 use App\Listeners\ModelDomainDeletingListener;
-
+use App\Listeners\ModelHostingSubscriptionCreatedListener;
+use App\Listeners\ModelHostingSubscriptionDeletingListener;
 use App\Policies\CustomerPolicy;
 use Filament\Facades\Filament;
 use Illuminate\Support\Facades\App;
@@ -49,10 +45,10 @@ class AppServiceProvider extends ServiceProvider
 
         Gate::define('delete-customer', [CustomerPolicy::class, 'delete']);
 
-        Event::listen(ModelDomainCreated::class,ModelDomainCreatedListener::class);
-        Event::listen(ModelDomainDeleting::class,ModelDomainDeletingListener::class);
+        Event::listen(ModelDomainCreated::class, ModelDomainCreatedListener::class);
+        Event::listen(ModelDomainDeleting::class, ModelDomainDeletingListener::class);
 
-        Event::listen(ModelHostingSubscriptionCreated::class,ModelHostingSubscriptionCreatedListener::class);
-        Event::listen(ModelHostingSubscriptionDeleting::class,ModelHostingSubscriptionDeletingListener::class);
+        Event::listen(ModelHostingSubscriptionCreated::class, ModelHostingSubscriptionCreatedListener::class);
+        Event::listen(ModelHostingSubscriptionDeleting::class, ModelHostingSubscriptionDeletingListener::class);
     }
 }

+ 7 - 7
web/app/Providers/Filament/AdminPanelProvider.php

@@ -43,7 +43,7 @@ class AdminPanelProvider extends PanelProvider
             ->brandLogo(asset('images/phyre-logo.svg'))
             ->brandLogoHeight('2.4rem')
             ->colors([
-                Color::Yellow
+                Color::Yellow,
             ])
 //            ->colors([
 //                'primary' => [
@@ -67,27 +67,27 @@ class AdminPanelProvider extends PanelProvider
             ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
             ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
 
-            ->discoverClusters(in: module_path('Microweber', 'Filament/Clusters'), for: "Modules\\Microweber\\Filament\\Clusters")
+            ->discoverClusters(in: module_path('Microweber', 'Filament/Clusters'), for: 'Modules\\Microweber\\Filament\\Clusters')
 
             ->pages([
                 Pages\Dashboard::class,
             ])
             ->plugins([
-              //  FilamentAuthenticationLogPlugin::make(),
+                //  FilamentAuthenticationLogPlugin::make(),
                 FilamentApexChartsPlugin::make(),
                 FilamentSettingsPlugin::make()->pages([
                     Settings::class,
-                ])
+                ]),
             ])
          //   ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
             ->widgets([
                 ServerDiskUsageStatistic::class,
                 ServerMemoryStatistic::class,
-               // ServerMemoryStatisticCount::class,
+                // ServerMemoryStatisticCount::class,
                 CustomersCount::class,
                 Websites::class,
-               // Widgets\AccountWidget::class,
-//                Widgets\FilamentInfoWidget::class,
+                // Widgets\AccountWidget::class,
+                //                Widgets\FilamentInfoWidget::class,
             ])
             ->middleware([
                 EncryptCookies::class,

+ 1 - 2
web/app/Settings.php

@@ -16,7 +16,7 @@ class Settings
     public static function general()
     {
         $settings = setting('general');
-        if (!empty($settings)) {
+        if (! empty($settings)) {
             foreach ($settings as $key => $value) {
                 if (isset(self::$general[$key])) {
                     self::$general[$key] = $value;
@@ -26,5 +26,4 @@ class Settings
 
         return self::$general;
     }
-
 }

+ 8 - 8
web/app/ShellApi.php

@@ -7,16 +7,16 @@ class ShellApi
     public static function exec($command, $argsArray = [])
     {
         $args = '';
-        if (!empty($argsArray)) {
+        if (! empty($argsArray)) {
             foreach ($argsArray as $arg) {
-                $args .= escapeshellarg($arg) . ' ';
+                $args .= escapeshellarg($arg).' ';
             }
         }
 
-        $fullCommand = $command . ' ' . $args;
+        $fullCommand = $command.' '.$args;
 
         // Run the command as sudo "/usr/bin/sudo "
-        $execOutput = shell_exec("/usr/bin/sudo " . $fullCommand);
+        $execOutput = shell_exec('/usr/bin/sudo '.$fullCommand);
         $execOutput = str_replace(PHP_EOL, '', $execOutput);
 
         return $execOutput;
@@ -25,14 +25,14 @@ class ShellApi
     public static function callBin($command, $argsArray = [])
     {
         $args = '';
-        if (!empty($argsArray)) {
+        if (! empty($argsArray)) {
             foreach ($argsArray as $arg) {
-                $args .= escapeshellarg($arg) . ' ';
+                $args .= escapeshellarg($arg).' ';
             }
         }
 
-        $fullCommand = escapeshellarg('/usr/local/phyre/bin/' . $command . '.sh') . ' ' . $args;
-        $commandAsSudo = '/usr/bin/sudo ' . $fullCommand;
+        $fullCommand = escapeshellarg('/usr/local/phyre/bin/'.$command.'.sh').' '.$args;
+        $commandAsSudo = '/usr/bin/sudo '.$fullCommand;
 
         $execOutput = shell_exec($commandAsSudo);
 

+ 20 - 24
web/app/Statistics/ServerStatistic.php

@@ -2,19 +2,17 @@
 
 namespace App\Statistics;
 
-use Illuminate\Support\Facades\Cache;
-
 class ServerStatistic
 {
     public function getCurrentStats()
     {
-        $memory =[
+        $memory = [
             'total' => 0,
             'used' => 0,
             'free' => 0,
             'shared' => 0,
             'buffCache' => 0,
-            'available' => 0
+            'available' => 0,
         ];
 
         $freeMemoryExec = shell_exec('free -m | grep Mem | awk \'{print $1 " " $2 " " $3 " " $4 " " $5 " " $6 " " $7}\'');
@@ -52,16 +50,16 @@ class ServerStatistic
             'used' => 0,
             'free' => 0,
             'usedPercentage' => 0,
-            'mountedOn' => ''
+            'mountedOn' => '',
         ];
         if (isset($diskMemoryExp[0])) {
-            $diskMemory['total'] = $diskMemoryExp[0]. 'B';
+            $diskMemory['total'] = $diskMemoryExp[0].'B';
         }
         if (isset($diskMemoryExp[1])) {
-            $diskMemory['used'] = $diskMemoryExp[1]. 'B';
+            $diskMemory['used'] = $diskMemoryExp[1].'B';
         }
         if (isset($diskMemoryExp[2])) {
-            $diskMemory['free'] = $diskMemoryExp[2]. 'B';
+            $diskMemory['free'] = $diskMemoryExp[2].'B';
         }
         if (isset($diskMemoryExp[3])) {
             $diskMemory['usedPercentage'] = $diskMemoryExp[3];
@@ -70,7 +68,7 @@ class ServerStatistic
         $cpuLoad = [
             '1min' => 0,
             '5min' => 0,
-            '15min' => 0
+            '15min' => 0,
         ];
         $cpuLoadExec = shell_exec('uptime');
         $cpuLoadExp = explode('load average:', $cpuLoadExec);
@@ -98,28 +96,26 @@ class ServerStatistic
             'disk' => $diskMemory,
             'cpu' => $cpuLoad,
             'totalTasks' => $totalTasks,
-            'uptime' => $uptime
+            'uptime' => $uptime,
         ];
 
     }
 
-    public function getFormattedFileSize($size, $precision) {
-        switch (true)
-        {
-            case ($size/1024 < 1):
+    public function getFormattedFileSize($size, $precision)
+    {
+        switch (true) {
+            case $size / 1024 < 1:
                 return $size.'B';
-            case ($size/pow(1024, 2) < 1):
-                return round($size/1024, $precision).'KB';
-            case ($size/pow(1024, 3) < 1):
-                return round($size/pow(1024, 2), $precision).'MB';
-            case ($size/pow(1024, 4) < 1):
-                return round($size/pow(1024, 3), $precision).'GB';
-            case ($size/pow(1024, 5) < 1):
-                return round($size/pow(1024, 4), $precision).'TB';
+            case $size / pow(1024, 2) < 1:
+                return round($size / 1024, $precision).'KB';
+            case $size / pow(1024, 3) < 1:
+                return round($size / pow(1024, 2), $precision).'MB';
+            case $size / pow(1024, 4) < 1:
+                return round($size / pow(1024, 3), $precision).'GB';
+            case $size / pow(1024, 5) < 1:
+                return round($size / pow(1024, 4), $precision).'TB';
             default:
                 return 'Error: invalid input or file is too large.';
         }
     }
-
-
 }

+ 0 - 1
web/app/VirtualHosts/ApacheVirtualHostConfigBase.php

@@ -14,5 +14,4 @@ abstract class ApacheVirtualHostConfigBase
 
         return $configValues;
     }
-
 }

+ 3 - 4
web/app/VirtualHosts/ApacheVirtualHostManager.php

@@ -15,16 +15,16 @@ class ApacheVirtualHostManager
     {
         $allConfigs = [];
         foreach ($this->registerConfigs as $module => $configs) {
-            if (!in_array($module, $forModules)) {
+            if (! in_array($module, $forModules)) {
                 continue;
             }
             foreach ($configs as $config) {
                 try {
                     $registerConfigInstance = app()->make($config);
                     $getConfig = $registerConfigInstance->getConfig();
-                    if (!empty($getConfig)) {
+                    if (! empty($getConfig)) {
                         foreach ($getConfig as $key => $value) {
-                            if (!isset($allConfigs[$key])) {
+                            if (! isset($allConfigs[$key])) {
                                 $allConfigs[$key] = [];
                             }
                             $allConfigs[$key] = array_merge($allConfigs[$key], $value);
@@ -38,5 +38,4 @@ class ApacheVirtualHostManager
 
         return $allConfigs;
     }
-
 }

+ 1 - 1
web/composer.json

@@ -32,7 +32,7 @@
     },
     "require-dev": {
         "fakerphp/faker": "^1.9.1",
-        "laravel/pint": "^1.0",
+        "laravel/pint": "^1.15",
         "laravel/sail": "^1.18",
         "mockery/mockery": "^1.4.4",
         "nunomaduro/collision": "^7.0",

+ 1 - 1
web/composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "bb37d9fbda9151cc830ea85df5e6d431",
+    "content-hash": "4abe345fdbef63cc6393bf28582dc8cf",
     "packages": [
         {
             "name": "acmephp/core",

+ 7 - 7
web/config/database.php

@@ -35,13 +35,13 @@ return [
 
     'connections' => [
 
-//        'sqlite' => [
-//            'driver' => 'sqlite',
-//            'url' => env('DATABASE_URL'),
-//            'database' => env('DB_DATABASE', database_path('database.sqlite')),
-//            'prefix' => '',
-//            'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
-//        ],
+        //        'sqlite' => [
+        //            'driver' => 'sqlite',
+        //            'url' => env('DATABASE_URL'),
+        //            'database' => env('DB_DATABASE', database_path('database.sqlite')),
+        //            'prefix' => '',
+        //            'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
+        //        ],
 
         'sqlite' => [
             'driver' => 'sqlite',

+ 39 - 39
web/config/filament-authentication-log.php

@@ -4,45 +4,45 @@ return [
 
     'notifications' => [
 
-//        'new-device' => [
-//
-//            // Send the NewDevice notification
-//
-//            'enabled' => env('NEW_DEVICE_NOTIFICATION', true),
-//
-//
-//
-//            // Use torann/geoip to attempt to get a location
-//
-//            'location' => true,
-//
-//
-//
-//            // The Notification class to send
-//
-//            'template' => \Rappasoft\LaravelAuthenticationLog\Notifications\NewDevice::class,
-//
-//        ],
-//
-//        'failed-login' => [
-//
-//            // Send the FailedLogin notification
-//
-//            'enabled' => env('FAILED_LOGIN_NOTIFICATION', false),
-//
-//
-//
-//            // Use torann/geoip to attempt to get a location
-//
-//            'location' => true,
-//
-//
-//
-//            // The Notification class to send
-//
-//            'template' => \Rappasoft\LaravelAuthenticationLog\Notifications\FailedLogin::class,
-//
-//        ],
+        //        'new-device' => [
+        //
+        //            // Send the NewDevice notification
+        //
+        //            'enabled' => env('NEW_DEVICE_NOTIFICATION', true),
+        //
+        //
+        //
+        //            // Use torann/geoip to attempt to get a location
+        //
+        //            'location' => true,
+        //
+        //
+        //
+        //            // The Notification class to send
+        //
+        //            'template' => \Rappasoft\LaravelAuthenticationLog\Notifications\NewDevice::class,
+        //
+        //        ],
+        //
+        //        'failed-login' => [
+        //
+        //            // Send the FailedLogin notification
+        //
+        //            'enabled' => env('FAILED_LOGIN_NOTIFICATION', false),
+        //
+        //
+        //
+        //            // Use torann/geoip to attempt to get a location
+        //
+        //            'location' => true,
+        //
+        //
+        //
+        //            // The Notification class to send
+        //
+        //            'template' => \Rappasoft\LaravelAuthenticationLog\Notifications\FailedLogin::class,
+        //
+        //        ],
 
     ],
 

+ 0 - 1
web/database/migrations/2024_04_01_073021_create_domain_ssl_certificates_table.php

@@ -32,7 +32,6 @@ return new class extends Migration
             $table->longText('private_key')->nullable();
             $table->longText('certificate_chain')->nullable();
 
-
             $table->timestamps();
         });
     }

+ 3 - 3
web/database/seeders/DatabaseSeeder.php

@@ -14,7 +14,7 @@ class DatabaseSeeder extends Seeder
     public function run(): void
     {
         $findHostingPlan = HostingPlan::where('slug', 'free')->first();
-        if (!$findHostingPlan) {
+        if (! $findHostingPlan) {
             HostingPlan::create([
                 'name' => 'Hosting Free',
                 'slug' => 'free',
@@ -37,7 +37,7 @@ class DatabaseSeeder extends Seeder
         }
 
         $findHostingPlan = HostingPlan::where('slug', 'basic')->first();
-        if (!$findHostingPlan) {
+        if (! $findHostingPlan) {
             HostingPlan::create([
                 'name' => 'Hosting Basic',
                 'slug' => 'basic',
@@ -60,7 +60,7 @@ class DatabaseSeeder extends Seeder
         }
 
         $findHostingPlan = HostingPlan::where('slug', 'pro')->first();
-        if (!$findHostingPlan) {
+        if (! $findHostingPlan) {
             HostingPlan::create([
                 'name' => 'Hosting Pro',
                 'slug' => 'pro',

部分文件因文件數量過多而無法顯示