Skip to content

Filament Architecture

Overview

The admin panel uses Filament v5 with two separate panels: Portal (main admin) and Education (teacher/student management). Each panel has its own middleware stack, theme, and resource set.

Panel Structure

PanelURLGuardAudience
Portal/portalportalHR, finance, recruitment, contracts
Education/educationeducationTeachers, academic staff

Folder Structure

app/Filament/
├── Clusters/                # Resource groups
│   ├── RecruitmentCluster/
│   ├── SystemSettings/
│   └── ...
├── Forms/
│   └── Components/          # Custom form components
│       ├── Inputs/          # Custom input fields
│       ├── Selects/         # Custom select fields
│       ├── Editors/         # Rich text editors
│       ├── Pickers/         # Date/Time pickers
│       ├── Media/           # File uploads
│       └── Containers/      # Layout containers
├── Schemas/
│   └── Components/          # Custom schema (infolist) components
│       ├── Cards/           # Info cards
│       ├── Stats/           # Statistics widgets
│       ├── Timeline/        # Activity timeline
│       └── Layout/          # Layout components
├── Pages/                   # Custom pages (auth, dashboard)
├── Resources/               # Filament resources organized by domain
│   ├── Applicants/
│   ├── Vacancies/
│   └── ...
└── Widgets/                 # Dashboard widgets

Resource Structure

Each resource follows one of two patterns:

Simple resource (minimal — schema/table inline):

Resource.php              # Schema + table defined directly in the class

Standard resource (organized — separate files):

Resource.php
├── Schemas/               # Form/Infolist schemas
│   ├── ResourceForm.php
│   └── ResourceInfolist.php
├── Tables/                # Table configurations
│   └── ResourceTable.php
└── Pages/                 # CRUD pages
    ├── ListResources.php
    ├── CreateResource.php
    ├── EditResource.php
    └── ViewResource.php

Custom Components

Filament built-ins are used by default, but custom components are created when the built-in doesn't meet the design requirement.

Form Components (app/Filament/Forms/Components/)

CategoryExamples
InputsCustom text inputs with specific validation/formatting
SelectsSearchable selects with custom option rendering
EditorsRich text editors with custom toolbars
PickersDate/time pickers with range selection
MediaFile upload with preview, drag-and-drop
ContainersLayout wrappers, tabs, wizards

Infolist Components (app/Filament/Schemas/Components/)

CategoryExamples
CardsInfo cards with icon, status, actions
StatsStatistics display widgets
TimelineActivity log timeline
LayoutColumn layouts, sections

Middleware Stack

Each panel has its own middleware stack in the Panel Provider:

PortalPanelProvider:
  EncryptCookies → AddQueuedCookies → StartSession → AuthenticateSession
  → ShareErrorsFromSession → PreventRequestForgery → SubstituteBindings
  → SetupMiddleware → MaintenanceMiddleware → DisableBladeIconComponents
  → EnsureUserCanAccessPortalPanel → Authenticate

Clusters

Resources are organized into clusters for logical grouping:

ClusterResources
RecruitmentClusterVacancies, Applicants, Candidates, Stages, Pipelines
SystemSettingsGeneral settings, Theme, Localization

Key Files

FilePurpose
app/Providers/Filament/PortalPanelProvider.phpPortal panel config, middleware, theme, resources
app/Providers/Filament/EducationPanelProvider.phpEducation panel config, middleware, theme
app/Filament/Resources/All Filament resources organized by domain
app/Filament/Forms/Components/Custom form components
app/Filament/Schemas/Components/Custom infolist components
app/Filament/Clusters/Resource cluster groupings
config/filament-shield.phpRole-based permission settings