for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Hechoenlaravel\JarvisFoundation\Traits;
use Hechoenlaravel\JarvisFoundation\Notifications\SendAppNotification\Middleware\SetTheUserId;
use Hechoenlaravel\JarvisFoundation\Notifications\SendAppNotification\SendAppNotificationCommand;
use Hechoenlaravel\JarvisFoundation\Notifications\SendAppNotification\Handler\SendAppNotificationCommandHandler;
/**
* Trait Notificable
* Use this trait to send notifications to a User.
* @author Jose Fonseca <[email protected]>
* @package Hechoenlaravel\JarvisFoundation\Traits
*/
trait Notificable
{
use DispatchesCommands;
* @param object $user
* @param $message
* @param string $type
* @param $link must be resolvable by url() helper
public function sendAppNotification($user, $message, $type = "info", $link = null)
$this->execute(SendAppNotificationCommand::class, SendAppNotificationCommandHandler::class, [
'user' => $user,
'type' => $type,
'message' => $message,
'link' => $link
], [
SetTheUserId::class
]);
}