public function show(Notification $notification) { $notification->markAsRead(); if ($notification->hasUrl()) { return redirect($notification->getUrl()); } return back(); }
public function creating(Notification $notification) { /** @var \App\Core\Notification\Notification $notificationClass */ $notificationClass = $notification->type; $notification->setAttribute('type', $notificationClass::getType()); }
public function ownsNotification(Notification $notification) { $notifiable = $notification->getNotifiable(); if ($this->is($notifiable)) { return true; } if ($this->hasShop() and $this->getShop()->is($notifiable)) { return true; } return false; }
public function handle() { Notification::unread()->delete(); }