Skip to content

Commit

Permalink
Allow users to override alert config (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoeunes authored Oct 27, 2021
1 parent 94a583d commit 245c495
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/LivewireAlertServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ protected function registerViews()
protected function registerAlertMacro()
{
Component::macro('alert', function ($type = 'success', $message = '', $options = []) {
$options = array_merge(config('livewire-alert.alert') ?? [], $options);
$options = array_merge(
config('livewire-alert.alert') ?? [],
config('livewire-alert.' . $type) ?? [],
$options
);

$this->dispatchBrowserEvent('alert', [
'type' => $type,
Expand Down

0 comments on commit 245c495

Please sign in to comment.