for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Notifications;
use App\TechTips;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
class NewTechTipComment extends Notification implements ShouldQueue
{
use Queueable;
protected $user, $tipID;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($user, $tipID)
//
$this->user = $user;
$this->tipID = $tipID;
}
* Get the notification's delivery channels.
* @param mixed $notifiable
* @return array
public function via($notifiable)
return ['database'];
* Get the mail representation of the notification.
* @return \Illuminate\Notifications\Messages\MailMessage
public function toMail($notifiable)
// return (new MailMessage)
// ->line('The introduction to the notification.')
// ->action('Notification Action', url('/'))
// ->line('Thank you for using our application!');
* Get the array representation of the notification.
public function toArray($notifiable)
$subject = TechTips::find($this->tipID)->subject;
return [
'type' => 'warning',
'message' => $this->user.' commented on your Tech Tip',
'link' => url(route(
'tip.details',
[
'id' => $this->tipID,
'name' => urlencode($subject)
]
))
];