public function getTables()
    {
        $tables = [
            0 => [
                'group' => 'Post Type',
                'options' => []
            ],
            1 => [
                'group' => 'Others',
                'options' => [
                    ['label' => 'Users', 'name' => 'users', 'belongsTo' => 'User'],
                ]
            ]
        ];
        // loop throw post types
        foreach(PostType::all() as $postType){
            $tables[0]['options'][] = ['label' => $postType['name'], 'name' => $postType['slug'], 'belongsTo' => 'PostType'];
        }
        return $tables;
    }
public function getTables()
    {
        $tables = [
            0 => [
                'group' => 'Post Type',
                'options' => []
            ],
            1 => [
                'group' => 'Others',
                'options' => [
                    ['label' => 'Users', 'name' => 'users', 'belongsTo' => 'User'],
                ]
            ]
        ];
        // loop throw post types
        foreach(PostType::all() as $postType){
            $tables[0]['options'][] = ['label' => $postType['name'], 'name' => $postType['slug'], 'belongsTo' => 'PostType'];
        }
        return $tables;
    }
public function getTables ( ) { $ tables = [ 0 => [ 'group' => 'Post Type' , 'options' => [ ] ] , 1 => [ 'group' => 'Others' , 'options' => [ [ 'label' => 'Users' , 'name' => 'users' , 'belongsTo' => 'User' ] , ] ] ] ; // loop throw post types foreach ( PostType :: all ( ) as $ postType ) { $ tables [ 0 ] [ 'options' ] [ ] = [ 'label' => $ postType [ 'name' ] , 'name' => $ postType [ 'slug' ] , 'belongsTo' => 'PostType' ] ; } return $ tables ; }
Generates a list of tables that can be used as data for custom field drop down.

@return array
@throws \Exception
Generates a list of tables that can be used as data for custom field drop down .