Files
Epicnabbo-Catalogus-Updated…/Updated_Cms/app/Filament/Tables/Columns/HabboBadgeColumn.php
T
2026-01-19 23:27:25 +01:00

36 lines
851 B
PHP

<?php
namespace App\Filament\Tables\Columns;
use App\Models\Compositions\HasBadge;
use Filament\Tables\Columns\Column;
class HabboBadgeColumn extends Column implements HasBadge
{
protected string $view = 'filament.tables.columns.habbo-badge-column';
public function getBadgePath(): string
{
$record = $this->getRecord();
if (! is_object($record) || ! method_exists($record, 'getBadgePath')) {
return '';
}
$path = $record->getBadgePath();
return is_string($path) ? $path : '';
}
public function getBadgeName(): string
{
$record = $this->getRecord();
if (! is_object($record) || ! method_exists($record, 'getBadgeName')) {
return '';
}
$name = $record->getBadgeName();
return is_string($name) ? $name : '';
}
}