diff --git a/composer.json b/composer.json index 7427576..f4cfc9d 100755 --- a/composer.json +++ b/composer.json @@ -13,6 +13,7 @@ "aws/aws-sdk-php": "^3.356", "bezhansalleh/filament-language-switch": "^3.1", "bezhansalleh/filament-shield": "^3.3", + "coolsam/modules": "^4.2", "filament/filament": "^3.3", "guzzlehttp/guzzle": "^7.10", "honeystone/laravel-seo": "^2.0", @@ -123,4 +124,4 @@ }, "minimum-stability": "stable", "prefer-stable": true -} \ No newline at end of file +} diff --git a/composer.lock b/composer.lock index a967635..821eb73 100755 --- a/composer.lock +++ b/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": "898c7af4e415c97ef44c8bdb50b17e45", + "content-hash": "79a82df066235bc578efb1a8890e720c", "packages": [ { "name": "amphp/amp", @@ -1603,6 +1603,84 @@ ], "time": "2025-08-20T19:15:30+00:00" }, + { + "name": "coolsam/modules", + "version": "v4.2.2", + "source": { + "type": "git", + "url": "https://github.com/savannabits/filament-modules.git", + "reference": "fb40e63c8aa5920613e4db06002045167d03ee25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/savannabits/filament-modules/zipball/fb40e63c8aa5920613e4db06002045167d03ee25", + "reference": "fb40e63c8aa5920613e4db06002045167d03ee25", + "shasum": "" + }, + "require": { + "filament/filament": "^3.0", + "nwidart/laravel-modules": "^11.0|^12.0", + "php": "^8.2", + "spatie/laravel-package-tools": "^1.15.0" + }, + "require-dev": { + "barryvdh/laravel-ide-helper": "^3.5", + "laravel/pint": "^1.0", + "nunomaduro/larastan": "^3.1.0", + "orchestra/testbench": "^9.12", + "pestphp/pest-plugin-laravel": "^3.1", + "pestphp/pest-plugin-livewire": "^3.0", + "phpstan/extension-installer": "^1.4.3", + "spatie/laravel-ray": "^1.39" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "FilamentModules": "FilamentModules" + }, + "providers": [ + "Coolsam\\Modules\\ModulesServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Coolsam\\Modules\\": "src/", + "Coolsam\\Modules\\Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sam Maosa", + "email": "maosa.sam@gmail.com", + "role": "Developer" + } + ], + "description": "Organize your Filament Code into modules using nwidart/laravel-modules", + "homepage": "https://github.com/savannabits/filament-modules", + "keywords": [ + "FilamentModules", + "coolsam", + "filament", + "laravel" + ], + "support": { + "issues": "https://github.com/savannabits/filament-modules/issues", + "source": "https://github.com/savannabits/filament-modules" + }, + "funding": [ + { + "url": "https://github.com/coolsam", + "type": "github" + } + ], + "time": "2025-09-03T10:49:06+00:00" + }, { "name": "danharrin/date-format-converter", "version": "v0.3.1", diff --git a/config/filament-activitylog.php b/config/filament-activitylog.php index 78b577d..d446398 100644 --- a/config/filament-activitylog.php +++ b/config/filament-activitylog.php @@ -16,7 +16,7 @@ 'default_sort_column' => 'id', 'default_sort_direction' => 'desc', 'navigation_count_badge' => false, - 'resource' => App\Filament\Pages\ActivityLog::class, + 'resource' => Modules\Admin\Filament\Pages\ActivityLog::class, ], 'date_format' => 'd/m/Y', 'datetime_format' => 'd/m/Y H:i:s', diff --git a/config/filament-modules.php b/config/filament-modules.php new file mode 100644 index 0000000..008c279 --- /dev/null +++ b/config/filament-modules.php @@ -0,0 +1,10 @@ + true, // whether to auto-register plugins from various modules in the Panel + 'clusters' => [ + 'enabled' => true, // whether to enable the clusters feature which allows you to group each module's filament resources and pages into a cluster + 'use-top-navigation' => true, // display the main cluster menu in the top navigation and the sub-navigation in the side menu, which improves the UI + ], +]; diff --git a/modules/Admin/app/Filament/AdminPlugin.php b/modules/Admin/app/Filament/AdminPlugin.php new file mode 100644 index 0000000..7a72a7e --- /dev/null +++ b/modules/Admin/app/Filament/AdminPlugin.php @@ -0,0 +1,27 @@ +title(__('Cache successfully cleared')) diff --git a/app/Filament/Pages/Settings/SecuritySettings.php b/modules/Admin/app/Filament/Pages/Settings/SecuritySettings.php similarity index 99% rename from app/Filament/Pages/Settings/SecuritySettings.php rename to modules/Admin/app/Filament/Pages/Settings/SecuritySettings.php index a996bf2..8ad55b1 100755 --- a/app/Filament/Pages/Settings/SecuritySettings.php +++ b/modules/Admin/app/Filament/Pages/Settings/SecuritySettings.php @@ -1,6 +1,6 @@ siteSettings->theme_mode ?? $this->siteSettings->theme_mode === 'light' ? ThemeMode::Light : ThemeMode::System)) ->darkMode($this->siteSettings->dark_mode_enabled ?? true) - ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources') - ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages') - ->pages([]) - ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets') - ->widgets([ - ArticleStatsOverview::class, - EntryStatsOverview::class, - CommentStatsOverview::class, - RecentArticles::class, - RecentEntries::class, - ]) ->middleware([ EncryptCookies::class, AddQueuedCookiesToResponse::class, @@ -148,6 +133,7 @@ protected function getPlugins(): array FilamentCookieConsent::make(), FilamentShieldPlugin::make(), ActivitylogPlugin::make(), + ModulesPlugin::make(), ]; } } diff --git a/modules/Admin/app/Providers/AdminServiceProvider.php b/modules/Admin/app/Providers/AdminServiceProvider.php new file mode 100644 index 0000000..b91b6e2 --- /dev/null +++ b/modules/Admin/app/Providers/AdminServiceProvider.php @@ -0,0 +1,22 @@ +|null */ diff --git a/modules/Category/app/Filament/CategoryPlugin.php b/modules/Category/app/Filament/CategoryPlugin.php new file mode 100644 index 0000000..ab831b6 --- /dev/null +++ b/modules/Category/app/Filament/CategoryPlugin.php @@ -0,0 +1,27 @@ +|null */ diff --git a/modules/News/app/Filament/Clusters/News.php b/modules/News/app/Filament/Clusters/News.php new file mode 100644 index 0000000..b6ffdf6 --- /dev/null +++ b/modules/News/app/Filament/Clusters/News.php @@ -0,0 +1,29 @@ +