public function scopeType($query, int $type = Tracker::TRACKER_ANY)
    {
        if ($type === Tracker::TRACKER_ANY) {
            return null;
        }

        return $query->where('trackable_type', $type);
    }
public function scopeType($query, int $type = Tracker::TRACKER_ANY)
    {
        if ($type === Tracker::TRACKER_ANY) {
            return null;
        }

        return $query->where('trackable_type', $type);
    }
public function scopeType ( $ query , int $ type = Tracker :: TRACKER_ANY ) { if ( $ type === Tracker :: TRACKER_ANY ) { return null ; } return $ query -> where ( 'trackable_type' , $ type ) ; }
Get tracker by trackable type

@param \Illuminate\Database\Query\Builder    $query
@param int $type
@return mixed
Get tracker by trackable type