Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

earmsby's avatar

footer widget appears in wrong place

From everything I've seen online, adding a footer widget to a view record should work this way:

"Filament widgets added to a page via getFooterWidgets() are displayed below the page content, but above the main page footer, which places them above the relationship manager if configured correctly."

Perhaps the key is "if configured correctly" My footer widget is displaying below the relationship manager section.

Here is the relevant part of my resource:

public static function getRelations(): array
    {
        return [
            RelationManagers\AuthorsRelationManager::class,
            RelationManagers\SalesTransactionsRelationManager::class,
            RelationManagers\PrintingsRelationManager::class,
            RelationManagers\ProductionStepsRelationManager::class,
            RelationManagers\ProductionNotesRelationManager::class
        ];
    }
public static function getWidgets(): array
    {
        return [
            SalesOverview::class,
        ];
    }

Then on the view I have this:

namespace App\Filament\Resources\Publications\Pages;
use App\Filament\Resources\Publications\Widgets\SalesOverview;
use App\Filament\Resources\Publications\PublicationResource;
use Filament\Actions\EditAction;
use Filament\Resources\Pages\ViewRecord;

class ViewPublication extends ViewRecord
{
    protected static string $resource = PublicationResource::class;

    protected function getFooterWidgets(): array
    {
        return [
            SalesOverview::class
        ];
    }

    protected function getHeaderActions(): array
    {
        return [
            EditAction::make()
                ->slideOver(),
        ];
    }

}

Finally, my widget itself is:

namespace App\Filament\Resources\Publications\Widgets;

use App\Models\Publication;
use Filament\Widgets\StatsOverviewWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;
use Illuminate\Database\Eloquent\Model;

class SalesOverview extends StatsOverviewWidget
{
    public ?Model $record = null;

    protected function getStats(): array
    {
        $publication = Publication::with('salesTransactions')->find($this->record->id);
        $total_sales = $publication->salesTransactions->sum('sales_dollars');
        $current_year_sales = $publication->salesTransactions()
            ->where('sales_year', date('Y'))
            ->sum('sales_dollars');

        return [
            Stat::make('All Time Sales', '$' . sprintf("%01.2f", $total_sales)),
            Stat::make('This Year Sales', '$' . sprintf("%01.2f", $current_year_sales)),
        ];
    }
}

The widget itself is working. It just displays below where I want it.

What is the magical correct configuration to display the widget below the view content and above the relationship manager section?

0 likes
2 replies
LaryAI's avatar
Level 58

It looks like you’ve hit a common stumbling block with Filament’s widget placement order on View pages. By default, getFooterWidgets() in a ViewRecord page displays widgets after all relationship managers—which is why your widget is appearing below the relationships section.

Why is this happening?

Filament’s ViewResource page layout sections are rendered in the following order:

  1. Header actions
  2. Header widgets (from getHeaderWidgets)
  3. Main content
  4. Footer widgets (from getFooterWidgets)
  5. Relations (from getRelations)

But on View pages, the “footer widgets” actually render after the relationships section, not between content and relations. This has been a somewhat confusing aspect of Filament’s design and is tracked in their issues/discussions.

Solution: Use Header Widgets Instead

If you want your widget to appear directly below the main content and above the relationship managers, you should place it in the header widgets, not footer widgets.

Modify your ViewPublication page like so:

namespace App\Filament\Resources\Publications\Pages;

use App\Filament\Resources\Publications\Widgets\SalesOverview;
use App\Filament\Resources\Publications\PublicationResource;
use Filament\Actions\EditAction;
use Filament\Resources\Pages\ViewRecord;

class ViewPublication extends ViewRecord
{
    protected static string $resource = PublicationResource::class;

    // Use header widgets instead of footer widgets
    protected function getHeaderWidgets(): array
    {
        return [
            SalesOverview::class,
        ];
    }

    protected function getHeaderActions(): array
    {
        return [
            EditAction::make()
                ->slideOver(),
        ];
    }
}

Remove your getFooterWidgets() method entirely.


Summary:
Add your widget to getHeaderWidgets() instead of getFooterWidgets() on your View page.
This places the widget after the main content and before relationships, which matches your goal.

References:

Let me know if you need a more advanced placement or a custom page layout!

earmsby's avatar

That doesn't work. It puts the widget at the very top of the page, not after the main content. I think this AI answer is being generated from an older version of Filament.

Please or to participate in this conversation.