Skip to content

Commit e4fae96

Browse files
committedMar 9, 2021
Flash issue fix - added fallback array to null config
1 parent 41a215e commit e4fae96

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/LivewireAlertServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function registerViews()
3030
protected function registerAlertMacro()
3131
{
3232
Component::macro('alert', function ($type = 'success', $message = '', $options = []) {
33-
$options = array_merge(config('livewire-alert.alert'), $options);
33+
$options = array_merge(config('livewire-alert.alert') ?? [], $options);
3434

3535
$this->dispatchBrowserEvent('alert', [
3636
'type' => $type,
@@ -43,7 +43,7 @@ protected function registerAlertMacro()
4343
public function registerFlashMacro()
4444
{
4545
Component::macro('flash', function ($type = 'success', $message = '', $options = []) {
46-
$options = array_merge(config('livewire-alert.alert'), $options);
46+
$options = array_merge(config('livewire-alert.alert') ?? [], $options);
4747

4848
session()->flash('livewire-alert', [
4949
'type' => $type,
@@ -56,7 +56,7 @@ public function registerFlashMacro()
5656
public function registerConfirmMacro()
5757
{
5858
Component::macro('confirm', function ($title, $options = []) {
59-
$options = array_merge(config('livewire-alert.confirm'), $options);
59+
$options = array_merge(config('livewire-alert.confirm') ?? [], $options);
6060

6161
$identifier = (string) Str::uuid();
6262

0 commit comments

Comments
 (0)