F
Filament8mo ago
Archy

Record title on deleted records

I'm looking for a way, to easily show the user, that they are viewing a deleted record. Currently the user has no way of knowing this when they're on the records View page. The actions to force delete or restore users are only available to admins in our app. I know I can simply create a field and display that on the ViewPage. But it would be preferred if the information is the very first thing they see, when visiting the deleted records page. Preferably append "(deleted)" or something like that to the record title attribute?
Solution:
I guess you could do something like this: ```php public function getTitle(): string|Htmlable {...
Jump to solution
2 Replies
Solution
dissto
dissto8mo ago
I guess you could do something like this:
public function getTitle(): string|Htmlable
{
return parent::getTitle() . ($this->record->trashed() ? ' (Deleted)' : '');
}
public function getTitle(): string|Htmlable
{
return parent::getTitle() . ($this->record->trashed() ? ' (Deleted)' : '');
}
Archy
ArchyOP8mo ago
Exactly what I was looking for. Thank you!
Want results from more Discord servers?
Add your server