diff --git a/app/Filament/Pages/Auth/Login.php b/app/Filament/Organizations/Pages/Auth/Login.php similarity index 92% rename from app/Filament/Pages/Auth/Login.php rename to app/Filament/Organizations/Pages/Auth/Login.php index 7726daca..ed344cef 100644 --- a/app/Filament/Pages/Auth/Login.php +++ b/app/Filament/Organizations/Pages/Auth/Login.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Filament\Pages\Auth; +namespace App\Filament\Organizations\Pages\Auth; use Filament\Pages\Auth\Login as BaseLogin; diff --git a/app/Filament/Pages/Dashboard.php b/app/Filament/Organizations/Pages/Dashboard.php similarity index 88% rename from app/Filament/Pages/Dashboard.php rename to app/Filament/Organizations/Pages/Dashboard.php index 263c687a..168ae152 100644 --- a/app/Filament/Pages/Dashboard.php +++ b/app/Filament/Organizations/Pages/Dashboard.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Filament\Pages; +namespace App\Filament\Organizations\Pages; use Filament\Pages\Dashboard as BaseDashboard; use Illuminate\Contracts\Support\Htmlable; diff --git a/app/Filament/Pages/Profile/UserPersonalInfo.php b/app/Filament/Organizations/Pages/Profile/UserPersonalInfo.php similarity index 97% rename from app/Filament/Pages/Profile/UserPersonalInfo.php rename to app/Filament/Organizations/Pages/Profile/UserPersonalInfo.php index a864f9ee..ae4fae10 100644 --- a/app/Filament/Pages/Profile/UserPersonalInfo.php +++ b/app/Filament/Organizations/Pages/Profile/UserPersonalInfo.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Filament\Pages\Profile; +namespace App\Filament\Organizations\Pages\Profile; use Filament\Facades\Filament; use Filament\Forms\Components\Group; diff --git a/app/Filament/Pages/Tenancy/EditOrganizationProfile.php b/app/Filament/Organizations/Pages/Tenancy/EditOrganizationProfile.php similarity index 98% rename from app/Filament/Pages/Tenancy/EditOrganizationProfile.php rename to app/Filament/Organizations/Pages/Tenancy/EditOrganizationProfile.php index 424aa88b..3adb325b 100644 --- a/app/Filament/Pages/Tenancy/EditOrganizationProfile.php +++ b/app/Filament/Organizations/Pages/Tenancy/EditOrganizationProfile.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Filament\Pages\Tenancy; +namespace App\Filament\Organizations\Pages\Tenancy; use App\Forms\Components\Location; use App\Rules\ValidCIF; diff --git a/app/Filament/Resources/BeneficiaryResource.php b/app/Filament/Organizations/Resources/BeneficiaryResource.php similarity index 96% rename from app/Filament/Resources/BeneficiaryResource.php rename to app/Filament/Organizations/Resources/BeneficiaryResource.php index de3559f7..e95acebb 100644 --- a/app/Filament/Resources/BeneficiaryResource.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Filament\Resources; +namespace App\Filament\Organizations\Resources; -use App\Filament\Resources\BeneficiaryResource\Pages; +use App\Filament\Organizations\Resources\BeneficiaryResource\Pages; use App\Models\Beneficiary; use Filament\Resources\Resource; use Filament\Tables; diff --git a/app/Filament/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php similarity index 94% rename from app/Filament/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php rename to app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php index 84338e0e..a225f7af 100644 --- a/app/Filament/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Filament\Resources\BeneficiaryResource\Pages; +namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages; -use App\Filament\Resources\BeneficiaryResource; +use App\Filament\Organizations\Resources\BeneficiaryResource; use App\Rules\ValidCNP; use Filament\Forms\Components\Checkbox; use Filament\Forms\Components\Grid; diff --git a/app/Filament/Resources/BeneficiaryResource/Pages/EditBeneficiaryIdentity.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/EditBeneficiaryIdentity.php similarity index 98% rename from app/Filament/Resources/BeneficiaryResource/Pages/EditBeneficiaryIdentity.php rename to app/Filament/Organizations/Resources/BeneficiaryResource/Pages/EditBeneficiaryIdentity.php index 6107d849..56f8c89f 100644 --- a/app/Filament/Resources/BeneficiaryResource/Pages/EditBeneficiaryIdentity.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/EditBeneficiaryIdentity.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace App\Filament\Resources\BeneficiaryResource\Pages; +namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages; use alcea\cnp\Cnp; use App\Enums\CivilStatus; use App\Enums\Gender; use App\Enums\IDType; -use App\Filament\Resources\BeneficiaryResource; +use App\Filament\Organizations\Resources\BeneficiaryResource; use App\Forms\Components\Location; use App\Forms\Components\Spacer; use App\Rules\ValidCNP; diff --git a/app/Filament/Resources/BeneficiaryResource/Pages/ListBeneficiaries.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ListBeneficiaries.php similarity index 71% rename from app/Filament/Resources/BeneficiaryResource/Pages/ListBeneficiaries.php rename to app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ListBeneficiaries.php index 7b129024..c4038e11 100644 --- a/app/Filament/Resources/BeneficiaryResource/Pages/ListBeneficiaries.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ListBeneficiaries.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Filament\Resources\BeneficiaryResource\Pages; +namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages; -use App\Filament\Resources\BeneficiaryResource; +use App\Filament\Organizations\Resources\BeneficiaryResource; use Filament\Actions; use Filament\Resources\Pages\ListRecords; diff --git a/app/Filament/Resources/BeneficiaryResource/Pages/ViewBeneficiary.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiary.php similarity index 94% rename from app/Filament/Resources/BeneficiaryResource/Pages/ViewBeneficiary.php rename to app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiary.php index 9cfd3fd7..aada5e63 100644 --- a/app/Filament/Resources/BeneficiaryResource/Pages/ViewBeneficiary.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiary.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Filament\Resources\BeneficiaryResource\Pages; +namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages; -use App\Filament\Resources\BeneficiaryResource; +use App\Filament\Organizations\Resources\BeneficiaryResource; use App\Infolists\Components\EnumEntry; use Filament\Infolists\Components\Actions\Action; use Filament\Infolists\Components\Section; diff --git a/app/Filament/Resources/CommunityProfileResource.php b/app/Filament/Organizations/Resources/CommunityProfileResource.php similarity index 98% rename from app/Filament/Resources/CommunityProfileResource.php rename to app/Filament/Organizations/Resources/CommunityProfileResource.php index c8da0f06..2e9b62a5 100644 --- a/app/Filament/Resources/CommunityProfileResource.php +++ b/app/Filament/Organizations/Resources/CommunityProfileResource.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Filament\Resources; +namespace App\Filament\Organizations\Resources; -use App\Filament\Resources\CommunityProfileResource\Pages; +use App\Filament\Organizations\Resources\CommunityProfileResource\Pages; use App\Models\CommunityProfile; use Filament\Infolists\Components\Grid; use Filament\Infolists\Components\Section; diff --git a/app/Filament/Resources/CommunityProfileResource/Pages/EditCommunityProfile.php b/app/Filament/Organizations/Resources/CommunityProfileResource/Pages/EditCommunityProfile.php similarity index 94% rename from app/Filament/Resources/CommunityProfileResource/Pages/EditCommunityProfile.php rename to app/Filament/Organizations/Resources/CommunityProfileResource/Pages/EditCommunityProfile.php index 801633fa..246463cf 100644 --- a/app/Filament/Resources/CommunityProfileResource/Pages/EditCommunityProfile.php +++ b/app/Filament/Organizations/Resources/CommunityProfileResource/Pages/EditCommunityProfile.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Filament\Resources\CommunityProfileResource\Pages; +namespace App\Filament\Organizations\Resources\CommunityProfileResource\Pages; -use App\Filament\Resources\CommunityProfileResource; +use App\Filament\Organizations\Resources\CommunityProfileResource; use Filament\Forms\Components\RichEditor; use Filament\Forms\Components\Section; use Filament\Forms\Components\SpatieMediaLibraryFileUpload; diff --git a/app/Filament/Resources/CommunityProfileResource/Pages/ListCommunityProfiles.php b/app/Filament/Organizations/Resources/CommunityProfileResource/Pages/ListCommunityProfiles.php similarity index 58% rename from app/Filament/Resources/CommunityProfileResource/Pages/ListCommunityProfiles.php rename to app/Filament/Organizations/Resources/CommunityProfileResource/Pages/ListCommunityProfiles.php index be12a325..bbc7e739 100644 --- a/app/Filament/Resources/CommunityProfileResource/Pages/ListCommunityProfiles.php +++ b/app/Filament/Organizations/Resources/CommunityProfileResource/Pages/ListCommunityProfiles.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Filament\Resources\CommunityProfileResource\Pages; +namespace App\Filament\Organizations\Resources\CommunityProfileResource\Pages; -use App\Filament\Resources\CommunityProfileResource; +use App\Filament\Organizations\Resources\CommunityProfileResource; use Filament\Resources\Pages\ListRecords; class ListCommunityProfiles extends ListRecords diff --git a/app/Filament/Resources/CommunityProfileResource/Pages/ViewCommunityProfile.php b/app/Filament/Organizations/Resources/CommunityProfileResource/Pages/ViewCommunityProfile.php similarity index 57% rename from app/Filament/Resources/CommunityProfileResource/Pages/ViewCommunityProfile.php rename to app/Filament/Organizations/Resources/CommunityProfileResource/Pages/ViewCommunityProfile.php index efa6acb9..8fb7d778 100644 --- a/app/Filament/Resources/CommunityProfileResource/Pages/ViewCommunityProfile.php +++ b/app/Filament/Organizations/Resources/CommunityProfileResource/Pages/ViewCommunityProfile.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Filament\Resources\CommunityProfileResource\Pages; +namespace App\Filament\Organizations\Resources\CommunityProfileResource\Pages; -use App\Filament\Resources\CommunityProfileResource; +use App\Filament\Organizations\Resources\CommunityProfileResource; use Filament\Resources\Pages\ViewRecord; class ViewCommunityProfile extends ViewRecord diff --git a/app/Filament/Resources/ServiceResource.php b/app/Filament/Organizations/Resources/ServiceResource.php similarity index 94% rename from app/Filament/Resources/ServiceResource.php rename to app/Filament/Organizations/Resources/ServiceResource.php index 074af7b7..c0b287c4 100644 --- a/app/Filament/Resources/ServiceResource.php +++ b/app/Filament/Organizations/Resources/ServiceResource.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Filament\Resources; +namespace App\Filament\Organizations\Resources; -use App\Filament\Resources\ServiceResource\Pages; +use App\Filament\Organizations\Resources\ServiceResource\Pages; use App\Models\Service; use Filament\Forms\Form; use Filament\Resources\Resource; diff --git a/app/Filament/Resources/ServiceResource/Pages/ManageServices.php b/app/Filament/Organizations/Resources/ServiceResource/Pages/ManageServices.php similarity index 67% rename from app/Filament/Resources/ServiceResource/Pages/ManageServices.php rename to app/Filament/Organizations/Resources/ServiceResource/Pages/ManageServices.php index fc539ee0..86d45059 100644 --- a/app/Filament/Resources/ServiceResource/Pages/ManageServices.php +++ b/app/Filament/Organizations/Resources/ServiceResource/Pages/ManageServices.php @@ -1,8 +1,10 @@ setDefaultDateTimeDisplayFormats(); + } + + public function panel(Panel $panel): Panel + { + return $panel + ->id('admin') + ->path('admin') + ->colors([ + 'primary' => Color::Red, + ]) + ->maxContentWidth('full') + ->viteTheme('resources/css/filament/common/theme.css') + ->brandLogo(fn () => view('filament.brand')) + ->brandLogoHeight('3rem') + ->discoverResources( + in: app_path('Filament/Admin/Resources'), + for: 'App\\Filament\\Admin\\Resources' + ) + ->discoverPages( + in: app_path('Filament/Admin/Pages'), + for: 'App\\Filament\\Admin\\Pages' + ) + ->pages([ + Pages\Dashboard::class, + ]) + ->discoverWidgets( + in: app_path('Filament/Admin/Widgets'), + for: 'App\\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 setDefaultDateTimeDisplayFormats(): void + { + Table::$defaultDateDisplayFormat = static::$defaultDateDisplayFormat; + Table::$defaultDateTimeDisplayFormat = static::$defaultDateTimeDisplayFormat; + Table::$defaultTimeDisplayFormat = static::$defaultTimeDisplayFormat; + + Infolist::$defaultDateDisplayFormat = static::$defaultDateDisplayFormat; + Infolist::$defaultDateTimeDisplayFormat = static::$defaultDateTimeDisplayFormat; + Infolist::$defaultTimeDisplayFormat = static::$defaultTimeDisplayFormat; + + DateTimePicker::$defaultDateDisplayFormat = static::$defaultDateDisplayFormat; + DateTimePicker::$defaultDateTimeDisplayFormat = static::$defaultDateTimeDisplayFormat; + DateTimePicker::$defaultDateTimeWithSecondsDisplayFormat = static::$defaultDateTimeWithSecondsDisplayFormat; + DateTimePicker::$defaultTimeDisplayFormat = static::$defaultTimeDisplayFormat; + DateTimePicker::$defaultTimeWithSecondsDisplayFormat = static::$defaultTimeWithSecondsDisplayFormat; + } +} diff --git a/app/Providers/Filament/OrganizationPanelProvider.php b/app/Providers/Filament/OrganizationPanelProvider.php index af2cbee1..cf452519 100644 --- a/app/Providers/Filament/OrganizationPanelProvider.php +++ b/app/Providers/Filament/OrganizationPanelProvider.php @@ -4,10 +4,7 @@ namespace App\Providers\Filament; -use App\Filament\Pages; -use App\Filament\Pages\Auth\Login; -use App\Filament\Pages\Profile\UserPersonalInfo; -use App\Filament\Pages\Tenancy\EditOrganizationProfile; +use App\Filament\Organizations\Pages; use App\Http\Middleware\ApplyTenantScopes; use App\Models\Organization; use Filament\Forms\Components\DateTimePicker; @@ -62,22 +59,28 @@ public function panel(Panel $panel): Panel ->id('organization') ->sidebarCollapsibleOnDesktop() ->collapsibleNavigationGroups(false) - ->login(Login::class) + ->login(Pages\Auth\Login::class) ->colors([ 'primary' => Color::Purple, ]) ->maxContentWidth('full') - ->viteTheme('resources/css/filament/organization/theme.css') + ->viteTheme('resources/css/filament/common/theme.css') ->brandLogo(fn () => view('filament.brand')) ->brandLogoHeight('3rem') - ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources') - ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages') + ->discoverResources( + in: app_path('Filament/Organizations/Resources'), + for: 'App\\Filament\\Organizations\\Resources' + ) + ->discoverPages( + in: app_path('Filament/Organizations/Pages'), + for: 'App\\Filament\\Organizations\\Pages' + ) ->pages([ - // Pages\Dashboard::class, + Pages\Dashboard::class, ]) ->discoverWidgets( - in: app_path('Filament/Widgets/Organizations'), - for: 'App\\Filament\\Widgets\\Organizations' + in: app_path('Filament/Organizations/Widgets'), + for: 'App\\Filament\\Organizations\\Widgets' ) ->widgets([ // Widgets\AccountWidget::class, @@ -93,7 +96,7 @@ public function panel(Panel $panel): Panel slug: 'settings' ) ->myProfileComponents([ - 'personal_info' => UserPersonalInfo::class, + 'personal_info' => Pages\Profile\UserPersonalInfo::class, ]) ->enableTwoFactorAuthentication(), ]) @@ -112,7 +115,7 @@ public function panel(Panel $panel): Panel Authenticate::class, ]) ->tenant(Organization::class, 'slug') - ->tenantProfile(EditOrganizationProfile::class) + ->tenantProfile(Pages\Tenancy\EditOrganizationProfile::class) ->tenantMiddleware([ // ApplyTenantScopes::class, ], isPersistent: true); diff --git a/config/app.php b/config/app.php index 7b1e188a..856dcb27 100644 --- a/config/app.php +++ b/config/app.php @@ -169,6 +169,7 @@ App\Providers\AuthServiceProvider::class, // App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, + App\Providers\Filament\AdminPanelProvider::class, App\Providers\Filament\OrganizationPanelProvider::class, App\Providers\RouteServiceProvider::class, ])->toArray(), diff --git a/resources/css/app.css b/resources/css/app.css deleted file mode 100644 index e69de29b..00000000 diff --git a/resources/css/filament/organization/tailwind.config.js b/resources/css/filament/common/tailwind.config.js similarity index 100% rename from resources/css/filament/organization/tailwind.config.js rename to resources/css/filament/common/tailwind.config.js diff --git a/resources/css/filament/organization/theme.css b/resources/css/filament/common/theme.css similarity index 100% rename from resources/css/filament/organization/theme.css rename to resources/css/filament/common/theme.css diff --git a/vite.config.js b/vite.config.js index 2fd2de7b..5ed165dd 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,7 +4,10 @@ import laravel from 'laravel-vite-plugin'; export default defineConfig({ plugins: [ laravel({ - input: ['resources/css/app.css', 'resources/css/filament/organization/theme.css', 'resources/js/app.js'], + input: [ + 'resources/css/filament/common/theme.css', + 'resources/js/app.js', + ], detectTls: 'sunrise.test', refresh: true, }),