class Illuminate / Notifications / DatabaseNotification
You are viewing an older version of the documentation. For the latest, please visit master documentation.

DatabaseNotification

Extends

Properties

protected

$keyType string

The "type" of the primary key ID.

Default: 'string'
public

$incrementing bool

Indicates if the IDs are auto-incrementing.

Default: false
protected

$table string

The table associated with the model.

Default: 'notifications'
protected

$guarded array

The guarded attributes on the model.

Default: []
protected

$casts array

The attributes that should be cast to native types.

Default: array

Methods

public

notifiable ( ) : MorphTo

Get the notifiable entity that the notification belongs to.

public

markAsRead ( ) : void

Mark the notification as read.

public

markAsUnread ( ) : void

Mark the notification as unread.

public

read ( ) : bool

Determine if a notification has been read.

public

unread ( ) : bool

Determine if a notification has not been read.

public

scopeRead ( Builder $query ) : Builder

Scope a query to only include read notifications.

Parameters

public

scopeUnread ( Builder $query ) : Builder

Scope a query to only include unread notifications.

Parameters

public

newCollection ( array $models ) : DatabaseNotificationCollection

Create a new database notification collection instance.

Parameters

  • $models array