Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times

You’ve hard-coded the term into the second query. Of course you are seeing the same thing every time:

$terms = get_terms( 
  'model',
  array(
    'orderby'    => 'count',
    'hide_empty' => 0
  ) 
);

if (!is_wp_error($terms)) {
  foreach( $terms as $term ) {
    // Define the query
    $args = array(
      'post_type' => 'peterbilt',
      'tax_query' => array(
        array(
          'taxonomy' => 'model',
          'field' => 'id',
          'terms' => $term->term_id
        )
      )
    );
    $query = new WP_Query( $args );
    // more code
  }
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)