Skip to content

Commit 68309a1

Browse files
committed
Add published icon to tree item
1 parent 59770f3 commit 68309a1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Resources/PageResource/Pages/ManagePageTree.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use SolutionForest\FilamentTree\Resources\Pages\TreePage;
99
use Statikbe\FilamentFlexibleContentBlockPages\Facades\FilamentFlexibleContentBlockPages;
1010
use Statikbe\FilamentFlexibleContentBlockPages\FilamentFlexibleContentBlockPagesConfig;
11+
use Statikbe\FilamentFlexibleContentBlocks\Models\Contracts\HasPageAttributes;
1112
use Statikbe\FilamentFlexibleContentBlocks\Models\Contracts\Linkable;
1213

1314
class ManagePageTree extends TreePage
@@ -74,9 +75,9 @@ protected function getFooterWidgets(): array
7475
return [];
7576
}
7677

77-
// CUSTOMIZE ICON OF EACH RECORD, CAN DELETE
78-
// public function getTreeRecordIcon(?\Illuminate\Database\Eloquent\Model $record = null): ?string
79-
// {
80-
// return null;
81-
// }
78+
public function getTreeRecordIcon(?Model $record = null): ?string
79+
{
80+
/** @var HasPageAttributes $record */
81+
return $record?->isPublished() ? null : 'heroicon-o-eye-slash' ;
82+
}
8283
}

0 commit comments

Comments
 (0)