diff --git a/web/Modules/Microweber/App/Models/MicroweberInstallation.php b/web/Modules/Microweber/App/Models/MicroweberInstallation.php new file mode 100644 index 0000000..b0b0997 --- /dev/null +++ b/web/Modules/Microweber/App/Models/MicroweberInstallation.php @@ -0,0 +1,22 @@ +app->register(RouteServiceProvider::class); + $this->app->register(AdminPanelProvider::class); } /** diff --git a/web/Modules/Microweber/Database/migrations/2024_04_02_205448_create_microweber_installations_table.php b/web/Modules/Microweber/Database/migrations/2024_04_02_205448_create_microweber_installations_table.php new file mode 100644 index 0000000..120d5c7 --- /dev/null +++ b/web/Modules/Microweber/Database/migrations/2024_04_02_205448_create_microweber_installations_table.php @@ -0,0 +1,48 @@ +id(); + + $table->bigInteger('website_id')->nullable(); + + $table->string('app_version')->nullable(); + $table->string('installation_type')->nullable(); + + $table->string('db_version')->nullable(); + $table->string('db_engine')->nullable(); + $table->string('db_host')->nullable(); + $table->string('db_port')->nullable(); + $table->string('db_name')->nullable(); + $table->string('db_user')->nullable(); + $table->string('db_password')->nullable(); + $table->string('db_prefix')->nullable(); + + $table->string('admin_email')->nullable(); + $table->string('admin_password')->nullable(); + $table->string('admin_username')->nullable(); + $table->string('admin_first_name')->nullable(); + $table->string('admin_last_name')->nullable(); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('microweber_installations'); + } +}; diff --git a/web/Modules/Microweber/Filament/Admin/Resources/MicroweberInstallationResource.php b/web/Modules/Microweber/Filament/Admin/Resources/MicroweberInstallationResource.php new file mode 100644 index 0000000..c27f590 --- /dev/null +++ b/web/Modules/Microweber/Filament/Admin/Resources/MicroweberInstallationResource.php @@ -0,0 +1,64 @@ +schema([ + // + ]); + } + + public static function table(Table $table): Table + { + return $table + ->columns([ + // + ]) + ->filters([ + // + ]) + ->actions([ + Tables\Actions\EditAction::make(), + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]); + } + + public static function getRelations(): array + { + return [ + // + ]; + } + + public static function getPages(): array + { + return [ + 'index' => Pages\ListMicroweberInstallations::route('/'), + 'create' => Pages\CreateMicroweberInstallation::route('/create'), + 'edit' => Pages\EditMicroweberInstallation::route('/{record}/edit'), + ]; + } +} diff --git a/web/Modules/Microweber/Filament/Admin/Resources/MicroweberInstallationResource/Pages/CreateMicroweberInstallation.php b/web/Modules/Microweber/Filament/Admin/Resources/MicroweberInstallationResource/Pages/CreateMicroweberInstallation.php new file mode 100644 index 0000000..b368a64 --- /dev/null +++ b/web/Modules/Microweber/Filament/Admin/Resources/MicroweberInstallationResource/Pages/CreateMicroweberInstallation.php @@ -0,0 +1,12 @@ +getModuleNamespace(); + return $panel + ->id('microweber::admin') + ->path('admin/modules/microweber') + ->colors([ + 'primary' => Color::Blue, + ]) + ->discoverResources(in: module_path($this->module, 'Filament/Admin/Resources'), for: "$moduleNamespace\\Filament\\Admin\\Resources") + ->discoverPages(in: module_path($this->module, 'Filament/Admin/Pages'), for: "$moduleNamespace\\Filament\\Admin\\Pages") + ->pages([ + Pages\Dashboard::class, + ]) + ->discoverWidgets(in: module_path($this->module, 'Filament/Admin/Widgets'), for: "$moduleNamespace\\Filament\\Admin\\Widgets") + ->widgets([ + Widgets\AccountWidget::class, + Widgets\FilamentInfoWidget::class, + ]) + ->middleware([ + EncryptCookies::class, + AddQueuedCookiesToResponse::class, + StartSession::class, + AuthenticateSession::class, + ShareErrorsFromSession::class, + VerifyCsrfToken::class, + SubstituteBindings::class, + DisableBladeIconComponents::class, + DispatchServingFilamentEvent::class, + ]) + ->authMiddleware([ + Authenticate::class, + ]); + } + + protected function getModuleNamespace(): string + { + return config('modules.namespace').'\\'.$this->module; + } +} diff --git a/web/Modules/Microweber/module.json b/web/Modules/Microweber/module.json index ae08d42..e528884 100644 --- a/web/Modules/Microweber/module.json +++ b/web/Modules/Microweber/module.json @@ -5,7 +5,8 @@ "keywords": [], "priority": 0, "providers": [ - "Modules\\Microweber\\App\\Providers\\MicroweberServiceProvider" + "Modules\\Microweber\\App\\Providers\\MicroweberServiceProvider", + "Modules\\Microweber\\Providers\\Filament\\AdminPanelProvider" ], "files": [] -} +} \ No newline at end of file diff --git a/web/modules-git.txt b/web/modules-git.txt new file mode 100644 index 0000000..3c9fbfd --- /dev/null +++ b/web/modules-git.txt @@ -0,0 +1 @@ +https://github.com/savannabits/filament-modules