Skip to content

Commit

Permalink
fix: edit comment & inbox resource
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiorodriguesroque committed Nov 13, 2024
1 parent b4c7b9b commit f8d1a9e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion app/Filament/Resources/CommentResource/Pages/EditComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}
3 changes: 2 additions & 1 deletion app/Filament/Resources/InboxResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f8d1a9e

Please sign in to comment.