PHP Class Fenos\Notifynder\Models\Notification

Inheritance: extends Illuminate\Database\Eloquent\Model
Show file Open project: fenos/notifynder Class Usage Examples

Protected Properties

Property Type Description
$fillable array

Public Methods

Method Description
__construct ( array $attributes = [] ) Notification constructor.
body ( ) : BelongsTo
from ( ) : BelongsTo | Illuminate\Database\Eloquent\Relations\MorphTo
getCustomFillableFields ( ) : mixed Get custom required fields from the configs so that we can automatically bind them to the model fillable property.
getExtraAttribute ( $value ) : ExtraParams
getNotifyBodyAttribute ( ) : string Get parsed body attributes.
getStack ( ) : null | Illuminate\Database\Eloquent\Collection Get the full stack of notifications if this has one.
getTextAttribute ( ) : string Get parsed body attributes.
hasStack ( ) : boolean Check if this notification is part of a stack.
newCollection ( array $models = [] ) : NotifynderCollection | Illuminate\Database\Eloquent\Collection Custom Collection.
scopeByCategory ( $query, $category ) : mixed Filter Scope by category.
scopeByStack ( $query, $stackId ) : mixed Filter Scope by stack.
scopeOnlyExpired ( $query ) : mixed Only Expired Notification scope.
scopeWherePolymorphic ( $query, $toId, $type ) : mixed Where Polymorphic.
scopeWithNotRead ( $query ) : mixed Not read scope.
to ( ) : BelongsTo | Illuminate\Database\Eloquent\Relations\MorphTo

Protected Methods

Method Description
mergeFillable ( ) : array

Method Details

__construct() public method

Notification constructor.
public __construct ( array $attributes = [] )
$attributes array

body() public method

public body ( ) : BelongsTo
return Illuminate\Database\Eloquent\Relations\BelongsTo

from() public method

public from ( ) : BelongsTo | Illuminate\Database\Eloquent\Relations\MorphTo
return Illuminate\Database\Eloquent\Relations\BelongsTo | Illuminate\Database\Eloquent\Relations\MorphTo

getCustomFillableFields() public method

Get custom required fields from the configs so that we can automatically bind them to the model fillable property.
public getCustomFillableFields ( ) : mixed
return mixed

getExtraAttribute() public method

public getExtraAttribute ( $value ) : ExtraParams
$value
return Fenos\Notifynder\Notifications\ExtraParams

getNotifyBodyAttribute() public method

Get parsed body attributes.
public getNotifyBodyAttribute ( ) : string
return string

getStack() public method

Get the full stack of notifications if this has one.
public getStack ( ) : null | Illuminate\Database\Eloquent\Collection
return null | Illuminate\Database\Eloquent\Collection

getTextAttribute() public method

Get parsed body attributes.
public getTextAttribute ( ) : string
return string

hasStack() public method

Check if this notification is part of a stack.
public hasStack ( ) : boolean
return boolean

mergeFillable() protected method

protected mergeFillable ( ) : array
return array

newCollection() public method

Custom Collection.
public newCollection ( array $models = [] ) : NotifynderCollection | Illuminate\Database\Eloquent\Collection
$models array
return NotifynderCollection | Illuminate\Database\Eloquent\Collection

scopeByCategory() public method

Filter Scope by category.
public scopeByCategory ( $query, $category ) : mixed
$query
$category
return mixed

scopeByStack() public method

Filter Scope by stack.
public scopeByStack ( $query, $stackId ) : mixed
$query
$stackId
return mixed

scopeOnlyExpired() public method

Only Expired Notification scope.
public scopeOnlyExpired ( $query ) : mixed
$query
return mixed

scopeWherePolymorphic() public method

Where Polymorphic.
public scopeWherePolymorphic ( $query, $toId, $type ) : mixed
$query
$toId
$type
return mixed

scopeWithNotRead() public method

Not read scope.
public scopeWithNotRead ( $query ) : mixed
$query
return mixed

to() public method

public to ( ) : BelongsTo | Illuminate\Database\Eloquent\Relations\MorphTo
return Illuminate\Database\Eloquent\Relations\BelongsTo | Illuminate\Database\Eloquent\Relations\MorphTo

Property Details

$fillable protected property

protected array $fillable
return array