Skip to content

Commit

Permalink
🎨 Add emotify helper and implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
mckenziearts committed Dec 12, 2019
1 parent 3651076 commit 8cb95e1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/LaravelNotify.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,20 @@ public function smiley(string $type, string $message) : LaravelNotify
return $this;
}

/**
* Return a smiley notify
*
* @param string $type
* @param string $message
* @return $this
*/
public function emotify(string $type, string $message) : LaravelNotify
{
$this->flash($message, $type, null, 'emotify');

return $this;
}

/**
* Return a drake notify
*
Expand All @@ -128,9 +142,9 @@ public function drake(string $type) : LaravelNotify
* Flash a message.
*
* @param string $message
* @param string $type
* @param string $icon
* @param string $model
* @param string|null $type
* @param string|null $icon
* @param string|null $model
* @param string|null $title
*
* @return void
Expand Down
15 changes: 15 additions & 0 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ function smilify(string $type, string $message)
return $notify;
}
}
if (! function_exists('emotify')) {
/**
* Smilify
*
* @param string $type
* @param string|null $message
* @return \Mckenziearts\Notify\LaravelNotify
*/
function emotify(string $type, string $message)
{
$notify = app('notify')->emotify($type, $message);

return $notify;
}
}

if (! function_exists('notifyJs')) {
/**
Expand Down

0 comments on commit 8cb95e1

Please sign in to comment.