mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Merge branch '3.x' into 4.x
This commit is contained in:
@@ -8,6 +8,7 @@ use Carbon\CarbonInterface;
|
||||
use Closure;
|
||||
use Filament\Support\Components\Component;
|
||||
use Filament\Support\Contracts\HasLabel as LabelInterface;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -35,7 +36,7 @@ class Group extends Component
|
||||
|
||||
protected ?Closure $scopeQueryByKeyUsing = null;
|
||||
|
||||
protected string | Closure | null $label = null;
|
||||
protected string | Htmlable | Closure | null $label = null;
|
||||
|
||||
protected string $id;
|
||||
|
||||
@@ -88,7 +89,7 @@ class Group extends Component
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function label(string | Closure | null $label): static
|
||||
public function label(string | Htmlable | Closure | null $label): static
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
@@ -181,7 +182,7 @@ class Group extends Component
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getLabel(): string
|
||||
public function getLabel(): string | Htmlable
|
||||
{
|
||||
return $this->evaluate($this->label) ?? (string) str($this->getId())
|
||||
->beforeLast('.')
|
||||
@@ -191,7 +192,7 @@ class Group extends Component
|
||||
->ucfirst();
|
||||
}
|
||||
|
||||
public function getDescription(Model $record, ?string $title): ?string
|
||||
public function getDescription(Model $record, string | Htmlable | null $title): string | Htmlable | null
|
||||
{
|
||||
if (! $this->getDescriptionFromRecordUsing) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user