diff --git a/resources/views/messages.blade.php b/resources/views/messages.blade.php
index 84358b9..5c85cb4 100644
--- a/resources/views/messages.blade.php
+++ b/resources/views/messages.blade.php
@@ -4,7 +4,7 @@
-
{{ session()->get('notify.type') }}
+
{{ session()->get('notify.title') ?? session()->get('notify.type') }}
{{ session()->get('notify.message') }}
diff --git a/src/LaravelNotify.php b/src/LaravelNotify.php
index 8349eb2..4a767a7 100644
--- a/src/LaravelNotify.php
+++ b/src/LaravelNotify.php
@@ -29,11 +29,12 @@ public function __construct(Session $session)
* Flash an information message.
*
* @param string $message
+ * @param string|null $title
* @return $this
*/
- public function info(string $message): self
+ public function info(string $message, string $title = null): self
{
- $this->flash($message, 'info', 'flaticon-exclamation-1', 'toast');
+ $this->flash($message, 'info', 'flaticon-exclamation-1', 'toast', $title);
return $this;
}
@@ -42,11 +43,12 @@ public function info(string $message): self
* Flash a success message.
*
* @param string $message
+ * @param string|null $title
* @return $this
*/
- public function success(string $message): self
+ public function success(string $message, string $title = null): self
{
- $this->flash($message, 'success', 'flaticon2-check-mark', 'toast');
+ $this->flash($message, 'success', 'flaticon2-check-mark', 'toast', $title);
return $this;
}
@@ -55,11 +57,12 @@ public function success(string $message): self
* Flash an error message.
*
* @param string $message
+ * @param string|null $title
* @return $this
*/
- public function error(string $message): self
+ public function error(string $message, string $title = null): self
{
- $this->flash($message, 'error', 'flaticon2-delete', 'toast');
+ $this->flash($message, 'error', 'flaticon2-delete', 'toast', $title);
return $this;
}
@@ -68,11 +71,12 @@ public function error(string $message): self
* Flash a warning message.
*
* @param string $message
+ * @param string|null $title
* @return $this
*/
- public function warning(string $message): self
+ public function warning(string $message, string $title = null): self
{
- $this->flash($message, 'warning', 'flaticon-warning-sign', 'toast');
+ $this->flash($message, 'warning', 'flaticon-warning-sign', 'toast', $title);
return $this;
}
diff --git a/src/helpers.php b/src/helpers.php
index 2c57ed1..0f00e06 100644
--- a/src/helpers.php
+++ b/src/helpers.php
@@ -4,15 +4,16 @@
/**
* Notify.
*
- * @param string|null $message
+ * @param string|null $message
+ * @param string|null $title
* @return \Mckenziearts\Notify\LaravelNotify
*/
- function notify(string $message = null)
+ function notify(string $message = null, string $title = null)
{
$notify = app('notify');
if (! is_null($message)) {
- return $notify->success($message);
+ return $notify->success($message, $title);
}
return $notify;
@@ -23,9 +24,9 @@ function notify(string $message = null)
/**
* Connectify.
*
- * @param string $type
- * @param string $title
- * @param string $message
+ * @param string $type
+ * @param string $title
+ * @param string $message
* @return \Mckenziearts\Notify\LaravelNotify
*/
function connectify(string $type, string $title, string $message)
@@ -40,7 +41,7 @@ function connectify(string $type, string $title, string $message)
/**
* Drakify.
*
- * @param string $type
+ * @param string $type
* @return \Mckenziearts\Notify\LaravelNotify
*/
function drakify(string $type)
@@ -55,8 +56,8 @@ function drakify(string $type)
/**
* Smilify.
*
- * @param string $type
- * @param string|null $message
+ * @param string $type
+ * @param string|null $message
* @return \Mckenziearts\Notify\LaravelNotify
*/
function smilify(string $type, string $message)
@@ -70,8 +71,8 @@ function smilify(string $type, string $message)
/**
* Emotify.
*
- * @param string $type
- * @param string|null $message
+ * @param string $type
+ * @param string|null $message
* @return \Mckenziearts\Notify\LaravelNotify
*/
function emotify(string $type, string $message)