You've already forked Epicnabbo-Catalogus-Updated-Daily
36 lines
851 B
PHP
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 : '';
|
|
}
|
|
}
|