Skip to content

Commit 00e36d5

Browse files
committed
Rename attributes to arguments
1 parent 643074c commit 00e36d5

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

resources/views/modal.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class="inline-block w-full align-bottom bg-white rounded-lg text-left overflow-h
4747
>
4848
@forelse($components as $id => $component)
4949
<div x-show.immediate="activeComponent == '{{ $id }}'" x-ref="{{ $id }}" wire:key="{{ $id }}">
50-
@livewire($component['name'], $component['attributes'], key($id))
50+
@livewire($component['name'], $component['arguments'], key($id))
5151
</div>
5252
@empty
5353
@endforelse

src/Modal.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function resetState(): void
2424
$this->activeComponent = null;
2525
}
2626

27-
public function openModal($component, $attributes = [], $modalAttributes = []): void
27+
public function openModal($component, $arguments = [], $modalAttributes = []): void
2828
{
2929
$requiredInterface = \LivewireUI\Modal\Contracts\ModalComponent::class;
3030
$componentClass = app(ComponentRegistry::class)->getClass($component);
@@ -34,16 +34,17 @@ public function openModal($component, $attributes = [], $modalAttributes = []):
3434
throw new Exception("[{$componentClass}] does not implement [{$requiredInterface}] interface.");
3535
}
3636

37-
$id = md5($component.serialize($attributes));
37+
$id = md5($component.serialize($arguments));
3838

39-
$attributes = collect($attributes)
40-
->merge($this->resolveComponentProps($attributes, new $componentClass()))
39+
$arguments = collect($arguments)
40+
->merge($this->resolveComponentProps($arguments, new $componentClass()))
4141
->all();
4242

4343

4444
$this->components[$id] = [
4545
'name' => $component,
46-
'attributes' => $attributes,
46+
'attributes' => $arguments,
47+
'arguments' => $arguments,
4748
'modalAttributes' => array_merge([
4849
'closeOnClickAway' => $componentClass::closeModalOnClickAway(),
4950
'closeOnEscape' => $componentClass::closeModalOnEscape(),

0 commit comments

Comments
 (0)