[增添]添加了datasource的setting数据库以及默认值

This commit is contained in:
makotocc0107
2024-08-27 09:57:44 +08:00
parent d111dfaea4
commit 72eb990970
10955 changed files with 978898 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace BladeUI\Icons\Components;
use Closure;
use Illuminate\View\Component;
final class Icon extends Component
{
public string $name;
public function __construct(string $name)
{
$this->name = $name;
}
public function render(): Closure
{
return function (array $data) {
$attributes = $data['attributes']->getIterator()->getArrayCopy();
$class = $attributes['class'] ?? '';
unset($attributes['class']);
return svg($this->name, $class, $attributes)->toHtml();
};
}
}