Filament Custom Fields, Columns &amp; Render Hooks | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://msaied.com) - [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [About](https://msaied.com#about)

           [  Contact](https://msaied.com#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://msaied.com)
- [ProjectsCase studies](https://msaied.com/projects)
- [ArticlesEngineering notes](https://msaied.com/articles)
- [CertificatesCredentials](https://msaied.com/certificates)
- [AboutHow I work](https://msaied.com#about)
- [ContactGet in touch](https://msaied.com#contact)

  [Start a conversation](https://msaied.com#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://msaied.com)
2. /
3. [Articles](https://msaied.com/articles)
4. /
5. Advanced Filament: Custom Field Plugins, Custom Columns, and Render Hooks

 Advanced Filament: Custom Field Plugins, Custom Columns, and Render Hooks
==========================================================================

 Go beyond built-in components: build a reusable Filament custom field plugin, register a custom table column with live state, and wire render hooks to inject UI without forking core.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://msaied.com#person) Published 5 Jul 2026 · Updated 5 Jul 2026 · 3 min read

ShareCopy linkCopied

 ![Advanced Filament: Custom Field Plugins, Custom Columns, and Render Hooks](https://cdn.msaied.com/366/1e40ce8bff9cc5db154e46389e0362e9.png) 

  On this page +1. [Why Extend Filament at the Component Level](#why-extend-filament-at-the-component-level)
2. [1. Custom Form Field Plugin](#1-custom-form-field-plugin)
3. [2. Custom Table Column](#2-custom-table-column)
4. [3. Render Hooks for Surgical UI Injection](#3-render-hooks-for-surgical-ui-injection)
5. [Packaging It All Together](#packaging-it-all-together)
6. [Key Takeaways](#key-takeaways)

 Why Extend Filament at the Component Level
------------------------------------------

Filament ships with a rich set of fields and columns, but production panels inevitably need components that don't exist yet — a colour-swatch picker, a rich diff viewer, a sparkline column. The wrong move is to fork core or paste raw Blade into a resource. The right move is to build a proper plugin that can be versioned, tested, and shared.

This article covers three extension points: a custom **Form field plugin**, a custom **Table column**, and **render hooks** for surgical UI injection.

---

1. Custom Form Field Plugin
---------------------------

A Filament field is a class that extends `Filament\Forms\Components\Field` and pairs with a Blade view.

```php
// src/Forms/Components/ColourSwatchPicker.php
namespace Acme\FilamentColour\Forms\Components;

use Filament\Forms\Components\Field;

class ColourSwatchPicker extends Field
{
    protected string $view = 'filament-colour::forms.components.colour-swatch-picker';

    /** @var array */
    protected array $swatches = [];

    public function swatches(array $colours): static
    {
        $this->swatches = $colours;
        return $this;
    }

    public function getSwatches(): array
    {
        return $this->swatches;
    }
}

```

The Blade view receives `$field` automatically:

```blade
{{-- resources/views/forms/components/colour-swatch-picker.blade.php --}}

        @foreach ($field->getSwatches() as $colour)

        @endforeach

```

Register it in your plugin's service provider so auto-discovery works:

```php
public function packageBooted(): void
{
    Filament::registerRenderHook('panels::body.end', fn () => '');
    // Blade component registration happens via package view namespace
}

```

Usage in a resource:

```php
ColourSwatchPicker::make('brand_colour')
    ->swatches(['#ef4444', '#3b82f6', '#22c55e'])
    ->required(),

```

---

2. Custom Table Column
----------------------

Custom columns extend `Filament\Tables\Columns\Column` and follow the same view convention.

```php
namespace Acme\FilamentColour\Tables\Columns;

use Filament\Tables\Columns\Column;

class ColourSwatchColumn extends Column
{
    protected string $view = 'filament-colour::tables.columns.colour-swatch-column';
}

```

```blade
{{-- tables/columns/colour-swatch-column.blade.php --}}

```

Because `$getState()` resolves through Filament's normal attribute pipeline, sorting, searching, and `formatStateUsing()` all work without extra effort.

```php
ColourSwatchColumn::make('brand_colour')
    ->label('Brand')
    ->sortable(),

```

---

3. Render Hooks for Surgical UI Injection
-----------------------------------------

Render hooks let you inject Blade output at named slots across every Filament panel without touching a single core file. They are registered in a service provider or panel provider.

```php
use Filament\Support\Facades\FilamentView;
use Illuminate\Support\Facades\Blade;

FilamentView::registerRenderHook(
    'panels::topbar.end',
    fn (): string => Blade::render(''),
);

```

Available hooks include `panels::body.start`, `panels::sidebar.nav.start`, `panels::page.start`, and many more — check the Filament docs for the full list per version.

For hooks that should only fire on specific pages, gate them:

```php
use Filament\Pages\Page;

FilamentView::registerRenderHook(
    'panels::page.end',
    fn (): string => Blade::render(''),
    scopes: App\Filament\Resources\OrderResource\Pages\EditOrder::class,
);

```

---

Packaging It All Together
-------------------------

Wrap everything in a Spatie Laravel Package Tools plugin:

```php
public function configurePackage(Package $package): void
{
    $package
        ->name('filament-colour')
        ->hasViews()
        ->hasConfigFile();
}

```

Filament's own plugin interface (`FilamentPlugin`) lets you hook into panel registration cleanly, giving you access to the panel instance for conditional logic.

---

Key Takeaways
-------------

- Extend `Field` or `Column` and pair with a namespaced Blade view — no hacks needed.
- `@entangle($getStatePath())` is the correct Alpine bridge for two-way field state.
- Render hooks are scoped to panels and pages, keeping injection surgical and reversible.
- Package everything with Spatie Package Tools; Filament's auto-discovery handles the rest.
- Custom columns inherit sorting, searching, and `formatStateUsing()` for free.

- [filament](https://msaied.com/articles?search=filament)
- [laravel](https://msaied.com/articles?search=laravel)
- [php](https://msaied.com/articles?search=php)
- [filament-plugins](https://msaied.com/articles?search=filament-plugins)

 Frequently asked questions 
---------------------------

  Can a custom Filament field support validation rules like built-in fields?Yes. Because your field extends `Filament\\Forms\\Components\\Field`, you can chain any built-in rule method (`-&gt;required()`, `-&gt;rules(\[\])`, `-&gt;minLength()`) and Filament's form validation pipeline treats it identically to a native field.

   How do render hooks differ between Filament v3 and v4?The hook names and the registration API are largely the same, but v4 introduced additional schema-level hooks tied to the unified Schema API. Always check the version-specific hook reference; hooks added in v4 will silently do nothing in a v3 panel.

   Is it safe to use Livewire components inside render hooks?Yes, using `Blade::render('&lt;livewire:my-component /&gt;')` inside a render hook works, but each call mounts a full Livewire component. Keep them lightweight and avoid mounting the same component on every page load if it carries heavy state.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://msaied.com#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://msaied.com#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articleLivewire v3 Performance and State Management Patterns](https://msaied.com/articles/livewire-v3-performance-and-state-management-patterns) [Next articleAdvanced Eloquent Casts: Custom Cast Classes, Value Objects, and Inbound-Only Transforms](https://msaied.com/articles/advanced-eloquent-casts-custom-cast-classes-value-objects-and-inbound-only-transforms-1)  

   On this page
-------------

1. [Why Extend Filament at the Component Level](#why-extend-filament-at-the-component-level)
2. [1. Custom Form Field Plugin](#1-custom-form-field-plugin)
3. [2. Custom Table Column](#2-custom-table-column)
4. [3. Render Hooks for Surgical UI Injection](#3-render-hooks-for-surgical-ui-injection)
5. [Packaging It All Together](#packaging-it-all-together)
6. [Key Takeaways](#key-takeaways)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://msaied.com#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/739/2d6897fdcdcf090613f96f72a64b8a78.png)  · 4 min read### MySQL Full-Text Search in Laravel: Indexes, Relevance Scoring, and Boolean Mode

4 Oct 2026 ](https://msaied.com/articles/mysql-full-text-search-in-laravel-indexes-relevance-scoring-and-boolean-mode) [ ![](https://cdn.msaied.com/738/073696a3fefe18bec825beec5ac658f5.png)  · 4 min read### Laravel Queue Rate-Limited Middleware: Throttling Jobs Without Losing Work

4 Oct 2026 ](https://msaied.com/articles/laravel-queue-rate-limited-middleware-throttling-jobs-without-losing-work) [ ![](https://cdn.msaied.com/737/f5c7e78a645325d4cff8d43f2835f136.png)  · 4 min read### Laravel Telescope Alternatives: Structured Observability with Pulse, Debugbar, and Custom Watchers

4 Oct 2026 ](https://msaied.com/articles/laravel-telescope-alternatives-structured-observability-with-pulse-debugbar-and-custom-watchers) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://msaied.com#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://msaied.com)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://msaied.com/sitemap.xml)
