wp_query display posts from same category of the post

I’ve found an answer:

<?php

    $cats = get_the_category();
    $args = array(
        'post_type' => 'article',
        'post__not_in' => array( get_the_ID() ),
        'posts_per_page' => 5,
        'cat'     => $cats[0]->term_id,
        'meta_query' => array(
                    array(
                    'key' => 'recommended_article',
                    'value' => '1',
                    'compare' => '=='
                        )
                    )
    );
    $query = new WP_Query( $args );

?>  

<?php if( $query->have_posts() ) : while( $query->have_posts() ) : $query->the_post(); ?>   

<!--HTML-->

<?php endwhile; endif; wp_reset_postdata(); ?>