Get taxonomy term by slug in post on archive page

On your code, the function wp_get_post_terms() return an array of WP_Term objects, so you can’t access directly to an object property without specifying an index for the array like :

$terms[0]->slug

Otherwise, you should iterate through the whole array of terms and retrieve the slug into an another array, like :

 $terms = wp_get_post_terms( $post_id, 'disciplines' );
    $terms_slug = [];
    foreach ($terms as $term) {
      $terms_slug[] = $term->slug;
    }

And finally, you can implode the all the gathered slugs into your class attribute :

class="filter-item <?= implode(' ', $terms_slug); ?>"

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