Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Notifications;
4
 
5
trait HasDatabaseNotifications
6
{
7
    /**
8
     * Get the entity's notifications.
9
     *
10
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
11
     */
12
    public function notifications()
13
    {
14
        return $this->morphMany(DatabaseNotification::class, 'notifiable')->latest();
15
    }
16
 
17
    /**
18
     * Get the entity's read notifications.
19
     *
20
     * @return \Illuminate\Database\Query\Builder
21
     */
22
    public function readNotifications()
23
    {
24
        return $this->notifications()->read();
25
    }
26
 
27
    /**
28
     * Get the entity's unread notifications.
29
     *
30
     * @return \Illuminate\Database\Query\Builder
31
     */
32
    public function unreadNotifications()
33
    {
34
        return $this->notifications()->unread();
35
    }
36
}