diff --git a/app/Filament/Resources/CommentResource/Pages/EditComment.php b/app/Filament/Resources/CommentResource/Pages/EditComment.php index 1a7f09a5..4bc6a701 100644 --- a/app/Filament/Resources/CommentResource/Pages/EditComment.php +++ b/app/Filament/Resources/CommentResource/Pages/EditComment.php @@ -2,6 +2,7 @@ namespace App\Filament\Resources\CommentResource\Pages; +use App\Models\Comment; use Filament\Actions\Action; use Filament\Actions\DeleteAction; use Filament\Resources\Pages\EditRecord; @@ -18,8 +19,14 @@ public function getHeaderActions(): array ->label(trans('resources.item.view-public')) ->color('gray') ->openUrlInNewTab() - ->url(fn () => route('items.show', $this->record->item) . '#comment-' . $this->record->id), + ->url(fn () => route('items.show', $this->getCurrentComment()->item) . '#comment-' . $this->getCurrentComment()->id), DeleteAction::make(), ]; } + + protected function getCurrentComment(): Comment + { + /** @var Comment */ + return $this->record; + } } diff --git a/app/Filament/Resources/InboxResource.php b/app/Filament/Resources/InboxResource.php index f4c07117..a88adbe8 100644 --- a/app/Filament/Resources/InboxResource.php +++ b/app/Filament/Resources/InboxResource.php @@ -49,7 +49,8 @@ public static function shouldRegisterNavigation(): bool public static function getNavigationBadge(): ?string { - return Item::query()->forInbox()->count(); + return (string) Item::query()->forInbox()->count(); + } public static function form(Form $form): Form