Attempting to reuse some of Filament internal views

I'm trying to build a custom View page for a resource, and I'm trying to use the built-in vendor/filament/filament/resources/views/resources/pages/view-record.blade.php something like this
<x-filament::page
:widget-data="['record' => $record]"
:class="\Illuminate\Support\Arr::toCssClasses([
'filament-resources-view-record-page',
'filament-resources-' . str_replace('/', '-', $this->getResource()::getSlug()),
'filament-resources-record-' . $record->getKey(),
])"
>
Hello there
</x-filament::page>
<x-filament::page
:widget-data="['record' => $record]"
:class="\Illuminate\Support\Arr::toCssClasses([
'filament-resources-view-record-page',
'filament-resources-' . str_replace('/', '-', $this->getResource()::getSlug()),
'filament-resources-record-' . $record->getKey(),
])"
>
Hello there
</x-filament::page>
class ViewBatch extends ViewRecord
{
protected static string $view = 'custom-view';
}
class ViewBatch extends ViewRecord
{
protected static string $view = 'custom-view';
}
However I only get the "hello there" text to show, I'm expecting like the widgets to show and the page title as "View <Record>" like it is on a default view page
1 Reply
Salty
SaltyOP2y ago
Furthermore, Phpstorm is displaying a warning stating Namespace 'x-filament' is not bound if I remove my custom view from the VIewBatch page, it show the "View Batch" header + all widgets defined nvm, I figured it out, I had forgotten the .blade in the file name
Want results from more Discord servers?
Add your server