src/Notification/Notification.php
public function scopeWhereSubjectModel(Builder $query, string $class)
    {
        $notificationTypes = array_filter(self::getSubjectModels(), function ($modelClass) use ($class) {
            return $modelClass === $class or is_subclass_of($class, $modelClass);
        });

        $query->whereIn('type', array_keys($notificationTypes));
    }
public function scopeWhereSubjectModel(Builder $query, string $class)
    {
        $notificationTypes = array_filter(self::getSubjectModels(), function ($modelClass) use ($class) {
            return $modelClass === $class or is_subclass_of($class, $modelClass);
        });

        $query->whereIn('type', array_keys($notificationTypes));
    }
public function scopeWhereSubjectModel ( Builder $ query , string $ class ) { $ notificationTypes = array_filter ( self :: getSubjectModels ( ) , function ( $ modelClass ) use ( $ class ) { return $ modelClass === $ class or is_subclass_of ( $ class , $ modelClass ) ; } ) ; $ query -> whereIn ( 'type' , array_keys ( $ notificationTypes ) ) ; }
Scope the query to include only notification types that use the given
subject model.

@param Builder $query
@param string $class
Scope the query to include only notification types that use the given subject model .