[增添]添加了datasource的setting数据库以及默认值
This commit is contained in:
26
vendor/filament/forms/src/Set.php
vendored
Normal file
26
vendor/filament/forms/src/Set.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Filament\Forms;
|
||||
|
||||
use Filament\Forms\Components\Component;
|
||||
|
||||
class Set
|
||||
{
|
||||
public function __construct(
|
||||
protected Component $component,
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(string | Component $path, mixed $state, bool $isAbsolute = false): mixed
|
||||
{
|
||||
$livewire = $this->component->getLivewire();
|
||||
|
||||
data_set(
|
||||
$livewire,
|
||||
$this->component->generateRelativeStatePath($path, $isAbsolute),
|
||||
$this->component->evaluate($state),
|
||||
);
|
||||
|
||||
return $state;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user