PHPackages                             gheith3/filament-relation-pages - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gheith3/filament-relation-pages

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gheith3/filament-relation-pages
===============================

A Filament plugin to add custom free-form pages as tabs alongside Relation Managers

v1.0.0(3mo ago)82.4k↑3726.7%1MITPHPPHP ^8.2CI passing

Since Apr 4Pushed 3mo agoCompare

[ Source](https://github.com/gheith3/filament-relation-pages)[ Packagist](https://packagist.org/packages/gheith3/filament-relation-pages)[ Docs](https://github.com/gheith3/filament-relation-pages)[ RSS](/packages/gheith3-filament-relation-pages/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (7)Versions (2)Used By (0)

Filament Relation Pages
=======================

[](#filament-relation-pages)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9cc309f42c7eefb44da3ccfd71120b19217cb3f2b0fcaa29a9e0340f862c987f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676865697468332f66696c616d656e742d72656c6174696f6e2d70616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gheith3/filament-relation-pages)[![Total Downloads](https://camo.githubusercontent.com/2bda3a95db6a059392fb8bfcffaa437c5c8277cf90c1c17b011857e4df8d252f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676865697468332f66696c616d656e742d72656c6174696f6e2d70616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gheith3/filament-relation-pages)[![Tests](https://camo.githubusercontent.com/39c21ee7454da4aede7169ef001764750c921c9255d2cf811b38bc1b461ca1ee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f676865697468332f66696c616d656e742d72656c6174696f6e2d70616765732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/gheith3/filament-relation-pages/actions/workflows/tests.yml)[![License](https://camo.githubusercontent.com/78b203699fc7331fd3f13da476ba418380ad4aca33d1f495cf810b0ad79e27f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f676865697468332f66696c616d656e742d72656c6174696f6e2d70616765732e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Add fully custom, free-form tabs alongside your Relation Managers in any Filament resource — no forced table, no forced relationship. Use Filament schema components, plain HTML, Alpine.js, or anything you like.

 [![Relation Pages Demo](screenshots/gheith3-relation-pages.png)](screenshots/gheith3-relation-pages.png)

 [![Relation Pages Demo](screenshots/image.png)](screenshots/image.png)

---

Requirements
------------

[](#requirements)

PackageVersionPHP^8.2Laravel^12.0 | ^13.0Filament^4.0 | ^5.0---

Installation
------------

[](#installation)

```
composer require gheith3/filament-relation-pages
```

The service provider is auto-discovered by Laravel — no manual registration needed.

---

Usage
-----

[](#usage)

### 1 — Generate a Relation Page

[](#1--generate-a-relation-page)

```
php artisan make:filament-relation-page BuildingSummaryPage --resource=Buildings
```

This creates two files:

```
app/Filament/Resources/Buildings/RelationPages/BuildingSummaryPage.php
resources/views/filament/resources/buildings/building-summary-page.blade.php

```

### 2 — Add Content to the Class

[](#2--add-content-to-the-class)

Open the generated PHP class and add your content:

```
use gheith3\FilamentRelationPages\RelationPage;
use Filament\Infolists\Components\TextEntry;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;
use Illuminate\Contracts\View\View;

class BuildingSummaryPage extends RelationPage
{
    protected static ?string $title = 'Summary';
    protected static string|BackedEnum|null $icon = 'heroicon-o-chart-bar';

    public function content(Schema $schema): Schema
    {
        return $schema->components([
            Section::make('Overview')->columns(3)->schema([
                TextEntry::make('name')->state($this->ownerRecord->name),
                TextEntry::make('units')->state($this->ownerRecord->units()->count()),
            ]),
        ]);
    }

    public function render(): View
    {
        return view('filament.resources.buildings.building-summary-page');
    }
}
```

### 3 — Register in the Resource

[](#3--register-in-the-resource)

```
// app/Filament/Resources/BuildingResource.php

public static function getRelations(): array
{
    return [
        RelationPages\BuildingSummaryPage::class,   // ← custom tab
        RelationManagers\UnitsRelationManager::class,
        // ...
    ];
}
```

That's it. The tab appears in the tab bar alongside your relation managers.

---

Blade View
----------

[](#blade-view)

The generated Blade view has two rendering modes:

```

    {{-- Option A: Filament components — powered by content(Schema $schema) --}}
    {{ $this->content }}

    {{-- Option B: Plain HTML — access the model via $this->ownerRecord --}}

        {{ $this->ownerRecord->name }}

```

Both modes can be mixed in the same view.

---

Available Features
------------------

[](#available-features)

### Tab customisation

[](#tab-customisation)

```
protected static ?string $title      = 'My Tab';
protected static ?string $icon       = 'heroicon-o-chart-bar';
protected static ?string $badge      = null;   // static badge text
protected static ?string $badgeColor = 'info';
```

### Dynamic badge (from a query)

[](#dynamic-badge-from-a-query)

Override `getBadge()` to compute the badge at runtime:

```
public static function getBadge(Model $ownerRecord, string $pageClass): ?string
{
    return (string) $ownerRecord->items()->count();
}
```

### Hide the tab conditionally

[](#hide-the-tab-conditionally)

```
public static function canViewForRecord(Model $ownerRecord, string $pageClass): bool
{
    return $ownerRecord->is_active;
}
```

### Lazy loading

[](#lazy-loading)

Set `$isLazy = true` to defer rendering the tab content until the tab is first visited, exactly like Filament's own `RelationManager`:

```
protected static bool $isLazy = true;
```

### Multiple schemas in one page

[](#multiple-schemas-in-one-page)

You can define multiple schema methods — each becomes independently renderable in Blade:

```
public function stats(Schema $schema): Schema { ... }
public function details(Schema $schema): Schema { ... }
```

```
{{ $this->stats }}
{{ $this->details }}
```

### Pass extra Livewire data

[](#pass-extra-livewire-data)

```
public static function getDefaultProperties(): array
{
    return ['mode' => 'compact'];
}

// Then in the class:
public string $mode = 'compact';
```

---

Artisan Command Reference
-------------------------

[](#artisan-command-reference)

```
# Standard usage
php artisan make:filament-relation-page BuildingSummaryPage --resource=Buildings

# Interactive — prompts for resource name
php artisan make:filament-relation-page BuildingSummaryPage

# Multi-panel apps — places the file inside app/Filament/Admin/Resources/...
php artisan make:filament-relation-page BuildingSummaryPage --resource=Buildings --panel=admin

# Overwrite existing files without being prompted
php artisan make:filament-relation-page BuildingSummaryPage --resource=Buildings --force
```

---

Customising Stubs
-----------------

[](#customising-stubs)

Publish the stubs to your project to customise the generated templates:

```
php artisan vendor:publish --tag=filament-relation-pages-stubs
```

Stubs are published to `stubs/filament-relation-pages/`.

---

How It Works
------------

[](#how-it-works)

Filament calls three static methods on every entry in `getRelations()`:

MethodPurpose`canViewForRecord()`Should the tab be visible for this record?`getTabComponent()`Returns the `Tab` with label / icon / badge`getDefaultProperties()`Extra Livewire props merged on mount`isLazy()`Whether to lazy-load the tab contentThen Filament mounts the class as a Livewire component, injecting `ownerRecord` and `pageClass` automatically. `RelationPage` implements `HasSchemas` + `HasActions` — the same stack Filament's own `RelationManager` uses — so all Filament form and infolist components work out of the box.

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md).

Security
--------

[](#security)

See [SECURITY.md](SECURITY.md).

License
-------

[](#license)

MIT — see [LICENSE.md](LICENSE.md).

Author
------

[](#author)

[Gheith](https://github.com/gheith3)

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance82

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

92d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12110656?v=4)[Gheith Alrawahi](/maintainers/gheith3)[@gheith3](https://github.com/gheith3)

---

Top Contributors

[![gheith3](https://avatars.githubusercontent.com/u/12110656?v=4)](https://github.com/gheith3 "gheith3 (7 commits)")

---

Tags

laravelfilamentfilament-pluginfilamentphppanelrelation managercustom-tab

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/gheith3-filament-relation-pages/health.svg)

```
[![Health](https://phpackages.com/badges/gheith3-filament-relation-pages/health.svg)](https://phpackages.com/packages/gheith3-filament-relation-pages)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M201](/packages/laravel-ai)[bezhansalleh/filament-language-switch

Zero config Language Switch(Changer/Localizer) plugin for filamentphp admin

3581.3M28](/packages/bezhansalleh-filament-language-switch)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

274327.0k8](/packages/croustibat-filament-jobs-monitor)[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

128192.3k3](/packages/dotswan-filament-map-picker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
