PHP code example of daun / statamic-widget-collection-count

1. Go to this page and download the library: Download daun/statamic-widget-collection-count library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

daun / statamic-widget-collection-count example snippets


return [
    'widgets' => [
        [
            'type' => 'collection_count',
            'collection' => 'projects'
        ]
    ]
];

return [
    'widgets' => [
        [
            'type' => 'collection_count',
            'collection' => 'projects',
            'count_unpublished' => false,
        ]
    ]
];

return [
    'widgets' => [
        [
            'type' => 'collection_count',
            'collection' => 'projects',
            'query_scope' => 'archived',
        ]
    ]
];

return [
    'widgets' => [
        [
            'type' => 'collection_count',
            'collection' => 'tags',
        ]
    ]
];