diff --git a/src/Traits/Toast.php b/src/Traits/Toast.php index b377a038..e7178ace 100644 --- a/src/Traits/Toast.php +++ b/src/Traits/Toast.php @@ -9,12 +9,12 @@ trait Toast public function toast( string $type, string $title, - string $description = null, - string $position = null, + ?string $description = null, + ?string $position = null, string $icon = 'o-information-circle', string $css = 'alert-info', int $timeout = 3000, - string $redirectTo = null + ?string $redirectTo = null ) { $toast = [ 'type' => $type, @@ -38,48 +38,48 @@ public function toast( public function success( string $title, - string $description = null, - string $position = null, + ?string $description = null, + ?string $position = null, string $icon = 'o-check-circle', string $css = 'alert-success', int $timeout = 3000, - string $redirectTo = null + ?string $redirectTo = null ) { return $this->toast('success', $title, $description, $position, $icon, $css, $timeout, $redirectTo); } public function warning( string $title, - string $description = null, - string $position = null, + ?string $description = null, + ?string $position = null, string $icon = 'o-exclamation-triangle', string $css = 'alert-warning', int $timeout = 3000, - string $redirectTo = null + ?string $redirectTo = null ) { return $this->toast('warning', $title, $description, $position, $icon, $css, $timeout, $redirectTo); } public function error( string $title, - string $description = null, - string $position = null, + ?string $description = null, + ?string $position = null, string $icon = 'o-x-circle', string $css = 'alert-error', int $timeout = 3000, - string $redirectTo = null + ?string $redirectTo = null ) { return $this->toast('error', $title, $description, $position, $icon, $css, $timeout, $redirectTo); } public function info( string $title, - string $description = null, - string $position = null, + ?string $description = null, + ?string $position = null, string $icon = 'o-information-circle', string $css = 'alert-info', int $timeout = 3000, - string $redirectTo = null + ?string $redirectTo = null ) { return $this->toast('info', $title, $description, $position, $icon, $css, $timeout, $redirectTo); } diff --git a/src/View/Components/Menu.php b/src/View/Components/Menu.php index b95e3ddb..f21d2bec 100644 --- a/src/View/Components/Menu.php +++ b/src/View/Components/Menu.php @@ -13,6 +13,7 @@ class Menu extends Component public function __construct( public ?string $title = null, public ?string $icon = null, + public ?string $iconClass = null, public ?bool $separator = false, public ?bool $activateByRoute = false, public ?string $activeBgColor = 'bg-base-300', @@ -29,7 +30,7 @@ public function render(): View|Closure|string
@if($icon) - + @endif {{ $title }} diff --git a/src/View/Components/MenuItem.php b/src/View/Components/MenuItem.php index e35955c4..df8b6146 100644 --- a/src/View/Components/MenuItem.php +++ b/src/View/Components/MenuItem.php @@ -14,6 +14,7 @@ class MenuItem extends Component public function __construct( public ?string $title = null, public ?string $icon = null, + public ?string $iconClass = null, public ?string $spinner = null, public ?string $link = null, public ?string $route = null, @@ -100,7 +101,7 @@ public function render(): View|Closure|string @if($icon) - + @endif diff --git a/src/View/Components/MenuSub.php b/src/View/Components/MenuSub.php index 1ae78b8b..3b4da256 100644 --- a/src/View/Components/MenuSub.php +++ b/src/View/Components/MenuSub.php @@ -13,6 +13,7 @@ class MenuSub extends Component public function __construct( public ?string $title = null, public ?string $icon = null, + public ?string $iconClass = null, public bool $open = false, public ?bool $enabled = true, ) { @@ -51,7 +52,7 @@ public function render(): View|Closure|string
$submenuActive])> @if($icon) - + @endif {{ $title }}