Enable block editor for WordPress custom post type

<?php

$args = [ 'show_in_rest' => true ];

register_post_type( 'post-type-slug', $args );