Custom Post Type | Fatal Error on register_post_type()

try these changes:

1) To use add_action() when your plugin or theme is built using classes instead of passing just the function name, you need to pass an array with a reference to the class ($this) and the callable function (‘custom_post_type’)

function __construct()
{
    add_action('init', array( $this, 'custom_post_type' ) );
}

2) The original ‘activate’ method called ‘custom_post_type’ suggesting that it only needs to be called once when the plugin is activated. But to properly register the custom post type, this method needs to be called every time WordPress is loaded which is why it is added to the ‘init’ hook. Calling it in the activate method doesn’t really make sense so I removed it.

function activate()
{
    flush_rewrite_rules();
}