for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace CleaniqueCoders\LaravelHelper\Services;
use CleaniqueCoders\LaravelHelper\Notifications\Notification;
class NotificationService
{
public $user;
public $subject;
public $content;
public $link;
public $link_label;
public $data;
public $template = 'laravel-helper::mail.notification';
public $cc;
public $bcc;
public $attachments;
public function __construct($identifier, $column = 'id')
$this->user = config('helper.models.user')::where($column, $identifier)->firstOrFail();
}
public static function make($identifier)
return new self($identifier);
public function subject($subject)
$this->subject = $subject;
return $this;
public function message($content)
$this->content = $content;
public function link($link)
$this->link = $link;
public function link_label($link_label)
$this->link_label = $link_label;
public function data($data)
$this->data = $data;
public function template($template)
$this->template = $template;
public function attachments($attachments)
$this->attachments = $attachments;
public function cc(array $cc)
$this->cc = $cc;
public function bcc(array $bcc)
$this->bcc = $bcc;
public function send()
if ($this->user) {
$this->user->notify(new Notification(
$this->subject,
$this->content,
$this->link,
$this->link_label,
$this->data,
$this->attachments,
$this->cc,
$this->bcc,
$this->template
));
} else {
throw new \CleaniqueCoders\LaravelHelper\Exceptions\NoUserSpecifiedException('No User Specified.', 1);