@@ -8,20 +8,20 @@ |
||
8 | 8 | |
9 | 9 | final class ComponentRegistrar |
10 | 10 | { |
11 | - private array $components = [ |
|
12 | - CardWidget::class |
|
13 | - ]; |
|
11 | + private array $components = [ |
|
12 | + CardWidget::class |
|
13 | + ]; |
|
14 | 14 | |
15 | - public function register(): void |
|
16 | - { |
|
17 | - array_map( |
|
18 | - fn(string $class) => Blade::component( |
|
19 | - forward_static_call( |
|
20 | - sprintf('%s::getComponentName', $class) |
|
21 | - ) ?? Str::camel($class), |
|
22 | - $class |
|
23 | - ), |
|
24 | - $this->components |
|
25 | - ); |
|
26 | - } |
|
15 | + public function register(): void |
|
16 | + { |
|
17 | + array_map( |
|
18 | + fn(string $class) => Blade::component( |
|
19 | + forward_static_call( |
|
20 | + sprintf('%s::getComponentName', $class) |
|
21 | + ) ?? Str::camel($class), |
|
22 | + $class |
|
23 | + ), |
|
24 | + $this->components |
|
25 | + ); |
|
26 | + } |
|
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -7,24 +7,24 @@ |
||
7 | 7 | class CardWidget extends Component |
8 | 8 | { |
9 | 9 | |
10 | - protected static ?string $name = 'card-widget'; |
|
10 | + protected static ?string $name = 'card-widget'; |
|
11 | 11 | |
12 | - public function __construct(public string $title, public string $description) |
|
13 | - { |
|
14 | - } |
|
12 | + public function __construct(public string $title, public string $description) |
|
13 | + { |
|
14 | + } |
|
15 | 15 | |
16 | - /** |
|
17 | - * @inheritDoc |
|
18 | - */ |
|
19 | - public function render(): string |
|
20 | - { |
|
21 | - return view( |
|
22 | - sprintf( |
|
23 | - '%s::%s', |
|
24 | - CoreServiceProvider::VIEWS_NAMESPACE, |
|
25 | - 'elements.widgets.simple-card' |
|
26 | - ) |
|
27 | - ) |
|
28 | - ->render(); |
|
29 | - } |
|
16 | + /** |
|
17 | + * @inheritDoc |
|
18 | + */ |
|
19 | + public function render(): string |
|
20 | + { |
|
21 | + return view( |
|
22 | + sprintf( |
|
23 | + '%s::%s', |
|
24 | + CoreServiceProvider::VIEWS_NAMESPACE, |
|
25 | + 'elements.widgets.simple-card' |
|
26 | + ) |
|
27 | + ) |
|
28 | + ->render(); |
|
29 | + } |
|
30 | 30 | } |
31 | 31 | \ No newline at end of file |