src/Notification/Notification.php
public function scopeWhereSubject(Builder $query, $model)
    {
        $query->whereSubjectModel(get_class($model))
            ->where('subject_id', $model->id);
    }
public function scopeWhereSubject(Builder $query, $model)
    {
        $query->whereSubjectModel(get_class($model))
            ->where('subject_id', $model->id);
    }
public function scopeWhereSubject ( Builder $ query , $ model ) { $ query -> whereSubjectModel ( get_class ( $ model ) ) -> where ( 'subject_id' , $ model -> id ) ; }
Scope the query to include only notifications that have the given
subject.

@param Builder $query
@param object $model
Scope the query to include only notifications that have the given subject .