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
MyResourceclass. - 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!