Is there a more elegant way to change breadcrump url in nested resource?
I have built this, but I dont like the solution.
2 Replies
public function getBreadcrumbs(): array
{
return collect(parent::getBreadcrumbs())
->mapWithKeys(fn ($value, $key) =>
str_contains($key, 'relation=goalEvaluations')
? [str_replace('?relation=goalEvaluations', '/zielauswertungen', $key) => 'Zielauswertung']
: [$key => $value]
)
->all();
}
Thank you very much!
That is indeed better. I was wondering if there was a 'filament way' of doing this.