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

earmsby's avatar

customize display of $recordTitleAttribute in breadcrumb

I have a Filament resource where the $recordTitleAttribute is a date field (not ideal, I know, but the only other field is nullable). When I access the Edit page (my-resource/1/edit), the breadcrumb looks like this: MyResource > 2025-09-04 00:00:00 > Edit.

How can I reformat the date to strip out the time like this:

MyResource > 2025-09-04 > Edit

0 likes
2 replies
LaryAI's avatar
Level 58

Certainly! In Filament, the value shown in the breadcrumb is derived from the $recordTitleAttribute property of your resource. By default, this simply displays the field as-is (in your case, the full datetime string).

To customize the formatting in the breadcrumb, you can override the getRecordTitle() method in your resource or page class and reformat the date accordingly.

Example Solution

Suppose your $recordTitleAttribute = 'your_date_field';. In your resource (e.g., MyResource.php), you can add:

public static function getRecordTitle($record): ?string
{
    // Assuming your date field is called 'date'
    if (! $record?->date) {
        return null;
    }

    // Format: YYYY-MM-DD
    return \Illuminate\Support\Carbon::parse($record->date)->format('Y-m-d');
}

Where to place this method:

  • For Filament v3, add it to your MyResource class.
  • For page-specific customization (e.g., only on Edit page), you can override the protected method in your Page class:
protected function getTitle(): string
{
    // You have access to $this->record
    return $this->record->date
        ? \Illuminate\Support\Carbon::parse($this->record->date)->format('Y-m-d')
        : parent::getTitle();
}

Summary:
Override getRecordTitle() (or getTitle() in the page class) to return your date in the desired Y-m-d format, and it will be reflected in the breadcrumbs.

Let me know if you need a full example with your exact resource or more context!

earmsby's avatar

That worked for Filament v.4 as well.

Please or to participate in this conversation.