Custom Page title changes by following the passed value

I'm trying to change the $title to be displaying by following the passed value
please note that the passed value is in integer product_id , then we can refer back to the relationship which is product.name .
As an example:
View Product Details - [passedvaluehere]

becomes,

View Product Details - Product1

this is my code:
class ViewProductDetails extends Page implements Tables\Contracts\HasTable
{
    use Tables\Concerns\InteractsWithTable;

    protected static ?string $navigationIcon = 'heroicon-o-document-text';
    protected static ?string $title = 'View Product Details ';
    protected static string $view = 'filament.pages.view-product-details';


    protected function getTableQuery(): Builder
    {
        $productId = request()->route('product');
        return Tradingprofile::where('product_id', $productId);
    }

    protected function getTableColumns(): array

    {
        return [
            TextColumn::make('customer.name')->label('Customer Name')->searchable(),

        ];
    }

    protected static function shouldRegisterNavigation(): bool
    {
        return false;
    }


Is there any way to hide from the id appears on the link above instead display the product name.
image.png
Solution
Something like this :
class ViewProduct extends ViewRecord
{
    // ...

    protected function getTitle(): string
    {
        return 'Product:' . $this->record->name;
    }
Was this page helpful?