type = $type; $this->follow = $follow; $this->sender = $sender; $this->target = $target; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * * @return array */ public function via($notifiable) { return ['database']; } /** * Get the array representation of the notification. * * @param mixed $notifiable * * @return array */ public function toArray($notifiable) { $appurl = config('app.url'); return [ 'title' => $this->sender->username.' Has Followed You!', 'body' => $this->sender->username.' has started to follow you so they will get notifications about your activities.', 'url' => "/users/{$this->sender->username}", ]; } }