
August 12, 2026
11 min read
By Kokil Thapa | Last reviewed: September 2026
You searched for the filament admin panel Laravel official documentation because the vendor docs explain components well but rarely show how a custom resource fits a real app. Filament 3 turns Eloquent models into admin CRUD through declarative PHP classes. This guide maps the official docs to production patterns I use on Laravel developer in Nepal client work—legal portals, booking systems, and internal tools. Start with the Filament official documentation, then apply the resource patterns below.
form(), table(), and getRelations() on a Resource class generated with make:filament-resource, wired to Eloquent models, policies, and panel config in Laravel 12 or 13.Where does the Filament admin panel Laravel official documentation fit custom resources?
Filament splits docs into panels, resources, forms, tables, and actions. Custom resources sit at the centre. Each resource is one PHP class that binds an Eloquent model to admin UI. The official pages describe API surface area. This section shows how those pieces connect on a live project.
Install the panel and read the right doc sections
On Laravel 12 or 13 with PHP 8.3+, install Filament 3 through Composer. Follow the panel installation guide in the vendor docs. Register your panel in a provider class. Set the path, middleware stack, and auth guard there. For framework context, cross-check the Laravel official documentation on service providers and middleware.
composer require filament/filament:"^3.3"
php artisan filament:install --panels After install, bookmark three doc areas: Resources, Form Builder, and Table Builder. Most custom work happens inside resource classes, not panel boot code. I keep panel providers thin. Heavy logic belongs in resources, policies, or dedicated action classes.
Generate a resource against your model
Every custom resource starts with Artisan. Always pass the model explicitly. Use --generate for a first draft, then audit the output.
php artisan make:filament-resource CaseFile --model=App\\Models\\CaseFile --generate The generator introspects columns and fillable fields. It creates text inputs by default. You still replace naive fields with Select, DatePicker, FileUpload, or RichEditor where business rules demand it. Never deploy generated schemas without review. Wrong validation on a legal-tech portal can expose fields that should stay internal.
The three methods that define behaviour
A Filament resource exposes three configuration hooks. Treat them as separate concerns:
form(Form $form): Form— Create and edit UI. Schema components carry validation through->rules()or inferred rules.table(Table $table): Table— List view with columns, filters, sorting, row actions, and bulk actions.getRelations(): array— RelationManager classes for nested CRUD on child models.
Keep form() focused on field definitions. Move complex conditionals into custom form components or small helper classes. That discipline stops 800-line resource files. For greenfield admin work, see our custom software development in Nepal service if you want implementation help beyond docs.
How do you handle relationships in Filament 3 custom resources?
Real apps rarely stop at one table. Cases have clients, documents, and invoices. The official docs cover Select, Repeater, and RelationManager separately. Pick the wrong pattern and you get N+1 queries or broken saves.
RelationManagers for independent child records
Generate a manager when child records have their own lifecycle. Documents on a case file fit this model well.
php artisan make:filament-relation-manager CaseFileResource documents title Register it in getRelations():
public static function getRelations(): array
{
return [
DocumentsRelationManager::class,
HearingsRelationManager::class,
];
} Each manager owns its own form() and table(). Editing a document does not resubmit the parent case. On a notary portal I maintained, this cut edit-page weight because we stopped eager-loading every attachment on the main form.
Select and Repeater for simpler links
For belongsTo links, use Select::make('client_id')->relationship('client', 'name'). Enable search and preload for large tables. For small hasMany sets edited with the parent, use Repeater. Invoice line items are a common fit.
Verify inverse relationships on the Eloquent model first. Missing documents() or client() methods produce empty selects and silent save failures. Pair this with Laravel N+1 query detection and fixes when list pages slow down.
The Mijar Law Associates client portal uses nested document workflows. RelationManagers kept uploads scoped per case without bloating the parent form.
How do you customize Filament 3 tables and add custom actions?
Default tables work for demos. Production lists need tuned queries, computed columns, and business actions. Most Filament slowness I see starts in the table query, not Livewire rendering.
Eager-load and index sort columns
Every relationship column triggers extra queries unless you eager-load. Override the table query or use ->modifyQueryUsing() with ->with(['client', 'assignedTo']). For computed values, avoid per-row queries inside getStateUsing(). Prefer model accessors backed by joins or cached aggregates.
Add database indexes on filtered and sorted columns. Filament's ->sortable() emits ORDER BY clauses. Without indexes, large tables crawl. Read database indexing for performance before blaming Filament.
Row, header, and bulk actions
Built-in CRUD actions cover basics. Business flows need custom Action classes. Example: generate a PDF brief from a case record.
Action::make('generate_pdf')
->label('Download Brief')
->icon('heroicon-o-document-arrow-down')
->action(function (CaseFile $record) {
$pdf = PdfGenerator::forCase($record);
return response()->streamDownload(
fn () => print($pdf->output()),
"case-{$record->number}.pdf"
);
})
->requiresConfirmation()
->visible(fn (CaseFile $record) => $record->status === 'approved') Put authorization in visible() and policy checks, not inside the action body after click. Filament evaluates visibility before render. That matches patterns in Laravel API best practices where gates run before handlers execute.
| Action Type | Use Case | Performance | Auth Pattern |
|---|---|---|---|
| Header Action | Create, export CSV, global import | Low — once per page | can('create') policy |
| Row Action | Edit, approve, PDF, single delete | Medium — per visible row | can('update', $record) |
| Bulk Action | Batch status change, mass assign | High — collection ops | can('deleteAny') or custom |
| Filter | Role-scoped or date filters | Variable — query cost | Global scope or policy scope |
Compare Filament with other admin options in Laravel Nova vs Filament vs Backpack if you are still choosing a stack.
How do you implement authorization in Filament 3 resources?
Admin panels fail audits when auth is bolted on late. Filament integrates with Laravel Policies and Spatie Permission. On legal-tech projects I enforce three layers: resource access, record scope, and field visibility.
Resource and record gates
Hide entire sections with canAccess() on the resource class:
public static function canAccess(): bool
{
return auth()->user()->hasPermissionTo('manage_cases');
} Wire standard policy methods — viewAny, update, delete — on the model. Filament calls them automatically when configured. For Spatie setup details, see Laravel Spatie Permission role management and policies and gates guide.
Tenancy and field-level control
Multi-tenant apps should use native panel tenancy. Define ->tenant(Company::class) in the panel provider. Queries scope automatically. Stop scattering where('company_id') across resources.
Hide sensitive fields with schema visibility:
TextInput::make('billing_rate')
->visible(fn () => auth()->user()->can('view_billing'))
->disabled(fn () => ! auth()->user()->can('edit_billing')) Enterprise panels with strict RBAC often need enterprise application development in Nepal level planning before the first resource ships.
How do you debug and optimize Filament 3 resource performance?
Filament hides Livewire and Alpine details. That abstraction helps until something breaks under load. Use a fixed checklist when a resource feels slow or flaky.
Fix slow table loads first
Open Laravel Debugbar on the list page. Twenty-five rows should not trigger fifty queries. Fix order:
- Eager-load every relationship used in columns and filters.
- Replace expensive
getStateUsing()logic with DB aggregates or cached attributes. - Default pagination to 25–50 rows. Drop "show all" on large tables.
- Index columns used in
->sortable()and->searchable().
Forms, uploads, and async work
Large repeaters and file fields can hit max_input_vars or post_max_size. Raise limits in PHP-FPM config when needed. Prefer Spatie Media Library for documents instead of inline base64 uploads.
Queue heavy imports and PDF jobs through Laravel queues with Redis. Blocking HTTP requests on 5,000-row CSV imports kills demos and production alike.
Validate schemas before deploy
Test that required fields reject bad input. Assert authorized roles see actions and hidden fields stay hidden. Filament ships testing helpers compatible with Pest. Pair admin tests with Form Request validation patterns on public-facing APIs sharing the same models.
When debugging JSON payloads from custom actions, a local JSON formatter saves time parsing API responses. Track framework upgrades through Laravel 12 new features so Filament packages stay compatible.
For a broader Filament walkthrough, read our Laravel Filament admin panel tutorial. The Adventure Third Pole Trek booking system shows Livewire admin patterns on a real Laravel app.
Key Takeaways
- Start at filamentphp.com/docs, then map Resources, Forms, and Tables docs to your Eloquent models.
- Generate resources with
--modeland--generate, but always audit form and table output before deploy. - Use RelationManagers for large or independent child data; Select and Repeater for simple links.
- Eager-load relationships in table queries and index sorted columns to prevent N+1 slowness.
- Enforce auth at resource, record, and field layers with policies and Spatie Permission.
- Queue imports and heavy actions; test resources with Pest before production release.
People Also Ask
What is a Filament resource in Laravel?
A Filament resource is a PHP class that connects one Eloquent model to admin CRUD UI. It defines forms for create/edit, tables for listing, and optional RelationManagers for child records. The panel router renders these automatically.
Does Filament 3 work with Laravel 12 and 13?
Yes. Filament 3 supports Laravel 11, 12, and 13 on PHP 8.2 or higher. Laravel 13 requires PHP 8.3 minimum. Check the Filament upgrade guide before bumping framework versions on existing panels.
How do I hide a Filament resource from certain users?
Override canAccess() on the resource class or rely on Laravel Policy viewAny methods. Combine with Spatie roles for menu-level control. Use schema visible() for field-level restrictions inside allowed records.
Where is the official Filament documentation for custom forms and tables?
The filament admin panel Laravel official documentation hosts Form Builder and Table Builder sections under filamentphp.com/docs. Custom resources reference those APIs inside form() and table() methods on your resource class.
Ship production Filament panels with confidence
This guide bridges the gap between the filament admin panel Laravel official documentation and the custom resource patterns production apps need. Generate resources deliberately, choose relationship components by data shape, optimize queries early, and layer authorization before launch. Filament 3 is mature enough for client portals and internal ops when configured with discipline. Need hands-on help building an admin panel for your Laravel app? Contact us to discuss your project, or reach out directly for a quick scoping call. Review modern Laravel architecture best practices to keep the wider app as clean as the panel.
Frequently Asked Questions
0 Comments
Leave a comment
Your email is not published. Comments appear once they have been read. Sign in to have your details filled in.

