© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
17 replies
fede8100

How to access the record on a custom page?

I have tried with $record, $model, etc, nothing works
Solution
What I do is instead of extending a
Page
Page
, I extend to a
ViewRecord
ViewRecord
and overwrite the
$view
$view
paramater.
Then the
$record
$record
is usable in the view and actions work.

example:
<?php

namespace App\Filament\Resources\ChargerResource\Pages;

use App\Filament\Resources\ChargerResource;
use Filament\Resources\Pages\ViewRecord;

class ChargerTransactions extends ViewRecord
{
    protected static string $resource = ChargerResource::class;

    protected static string $view = 'chargers.transactions';
}
<?php

namespace App\Filament\Resources\ChargerResource\Pages;

use App\Filament\Resources\ChargerResource;
use Filament\Resources\Pages\ViewRecord;

class ChargerTransactions extends ViewRecord
{
    protected static string $resource = ChargerResource::class;

    protected static string $view = 'chargers.transactions';
}
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to edit record using modal on the custom page?
FilamentFFilament / ❓┊help
3y ago
custom page access
FilamentFFilament / ❓┊help
3y ago
how to change the title on a custom page?
FilamentFFilament / ❓┊help
2y ago