Skip to content

Commit

Permalink
add breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexPopaCode4 committed Jun 7, 2024
1 parent d4e4c87 commit 41d76e1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@
namespace App\Filament\Organizations\Resources\BeneficiaryResource\Pages;

use App\Filament\Organizations\Resources\BeneficiaryResource;
use App\Services\Breadcrumb\Beneficiary as BeneficiaryBreadcrumb;
use Filament\Resources\Pages\ViewRecord;
use Illuminate\Contracts\Support\Htmlable;

class ListDocuments extends ViewRecord
{
protected static string $resource = BeneficiaryResource::class;

public function getBreadcrumbs(): array
{
return BeneficiaryBreadcrumb::make($this->record)
->getBreadcrumbsForDocuments();
}

protected function getHeaderWidgets(): array
{
return [
Expand Down
10 changes: 10 additions & 0 deletions app/Services/Breadcrumb/Beneficiary.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,14 @@ public function getBreadcrumbsForSpecialists(): array
[self::$resourcePath::getUrl('view_specialists', ['record' => $this->record->id]) => $breadcrumb],
);
}

public function getBreadcrumbsForDocuments(): array
{
$breadcrumb = __('beneficiary.section.documents.title.page');

return array_merge(
$this->getBaseBreadcrumbs(),
[self::$resourcePath::getUrl('view_documents', ['record' => $this->record->id]) => $breadcrumb],
);
}
}

0 comments on commit 41d76e1

Please sign in to comment.