FilamentF
Filamentβ€’3y ago
terumi

Custom page model instance

Hello people,
I made a new custom page for a filament resource with
php artisan make:filament-page ShowTicket --resource=TicketResource

And it created two files:
1. resources/views/filament/resources/ticket-resource/pages/show-ticket.blade.php, and
2. app/Filament/Resources/TicketResource/Pages/ShowTicket.php


How can I pass now the instance of the model record whose view link I clicked?
I'm being redirected to tickets/{ticket_id} but I cannot find anywhere how I can show the ticket properties.

Any help would be greatly apreciated πŸ™‚
Solution
use \Filament\Resources\Pages\Concerns\InteractsWithRecord;
public function mount(int | string $record): void
{
    $this->record = $this->resolveRecord($record);
}
Was this page helpful?