notCharles 6284c73edb wip
2025-04-24 20:02:20 -04:00

50 lines
935 B
PHP

<?php
namespace App\Filament\Server\Components;
use Closure;
use Filament\Widgets\StatsOverviewWidget\Stat;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Contracts\View\View;
class SmallStatBlock extends Stat
{
protected string|\Closure|Htmlable|null $label;
protected $value;
public function label(string|Htmlable|Closure|null $label): static
{
$this->label = $label;
return $this;
}
public function value($value): static
{
$this->value = $value;
return $this;
}
public function getLabel(): string|Htmlable
{
return $this->label;
}
public function getValue(): mixed
{
return value($this->value);
}
public function toHtml(): string
{
return $this->render()->render();
}
public function render(): View
{
return view('filament.components.server-small-data-block');
}
}