PHPackages                             michallkanak/symfony-cloudflare-multi-view - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. michallkanak/symfony-cloudflare-multi-view

ActiveSymfony-bundle[API Development](/categories/api)

michallkanak/symfony-cloudflare-multi-view
==========================================

Symfony Bundle for fetching, aggregating and presenting Cloudflare GraphQL analytics across multiple domains and accounts at once.

0.1.1(4w ago)10MITPHPPHP &gt;=8.1CI passing

Since Apr 19Pushed 4w agoCompare

[ Source](https://github.com/michallkanak/symfony-cloudflare-multi-view)[ Packagist](https://packagist.org/packages/michallkanak/symfony-cloudflare-multi-view)[ RSS](/packages/michallkanak-symfony-cloudflare-multi-view/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (18)Versions (3)Used By (0)

Symfony Cloudflare Multi-View Bundle
====================================

[](#symfony-cloudflare-multi-view-bundle)

[![Tests](https://github.com/michallkanak/symfony-cloudflare-multi-view/actions/workflows/tests.yml/badge.svg)](https://github.com/michallkanak/symfony-cloudflare-multi-view/actions/workflows/tests.yml)[![PHPStan](https://camo.githubusercontent.com/d117944b58da8146f96b4ef7403807610a20eeb3fbcaaaf95157bbcdad1686eb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d627269676874677265656e2e737667)](https://phpstan.org/)[![Code Style](https://camo.githubusercontent.com/5a98380c0a85158f60cd6883d1378aa12f15e3e232ed808a610f275de029096b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d5048502d2d43532d2d46697865722d6f72616e67652e737667)](https://cs.symfony.com/)[![Packagist Version](https://camo.githubusercontent.com/165b2221d2f98bfd3d6028cc113093d21ae9be3fddfc82eb26f87bbc6eddb8a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696368616c6c6b616e616b2f73796d666f6e792d636c6f7564666c6172652d6d756c74692d766965772e737667)](https://packagist.org/packages/michallkanak/symfony-cloudflare-multi-view)[![Symfony Version](https://camo.githubusercontent.com/63e5a89f3699b2f85b0e5de3590818458232cd2dac7fd3347240a6c54dc67b1a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d352e34253230253743253230362e78253230253743253230372e782d626c75652e737667)](https://symfony.com/)[![PHP Version](https://camo.githubusercontent.com/fb7c72456e13f7d5ecf8486e29d02a2e6775aaf4d18622a63529976b0ed0740e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d707572706c652e737667)](https://www.php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Symfony bundle for monitoring and visualizing traffic across multiple Cloudflare domains and accounts. It provides a beautiful, password-protected dashboard with real-time analytics, daily/hourly trends, and group-based organization.

### Dashboard Preview

[](#dashboard-preview)

[![Dashboard View](docs/images/dashboard.png)](docs/images/dashboard.png)

### Secure Login

[](#secure-login)

[![Login Page](docs/images/login.png)](docs/images/login.png)

Features
--------

[](#features)

- **Multi-domain aggregation**: See stats for all your Cloudflare zones in one place.
- **Grouped view**: Organize domains into logical Cloudflare accounts groups for better management.
- **Modern Dashboard**: Sleek, glassmorphism UI with dark mode support.
- **Interactive Charts**: Responsive charts for requests and unique visitors (powered by Chart.js).
- **Timezone Support**: View data in your preferred local time.
- **Persistent State**: Remembers your sorting and chart visibility preferences.
- **Geographical Analytics**: Tracks Top 3 countries of origin for traffic with color-coded trend lines.
- **Security**: Password-protected dashboard isolated from your main app. Implements CSRF protection and honeypot to prevent bot attacks.
- **Scalable**: Built-in API rate limiting and retry logic for Cloudflare API.
- **Translations**: Built-in support for multiple languages: English, Polish, French, German, Spanish, Italian, Czech, Swedish.

Installation
------------

[](#installation)

1. Install via composer:

    ```
    composer require michallkanak/symfony-cloudflare-multi-view
    ```
2. Register the bundle in `config/bundles.php`:

    ```
    return [
        // ...
        Michallkanak\SymfonyCloudflareMultiView\CfMultiViewBundle::class => ['all' => true],
    ];
    ```

Configuration
-------------

[](#configuration)

### 1. Main Configuration

[](#1-main-configuration)

Create `config/packages/cf_multi_view.yaml`:

```
cf_multi_view:
  dashboard_password: "%env(CF_DASHBOARD_PASSWORD)%"
  secure_dashboard: true # set to false to disable password protection
  timezone: "Europe/Warsaw"

  accounts:
    - name: "Main Account"
      token: "%env(CF_TOKEN_MAIN)%"
    - name: "Staging Account"
      token: "%env(CF_TOKEN_STAGING)%"
```

Each `account.name` becomes the **group label** on the dashboard. Domains are automatically assigned to their account group.

### 2. Routing

[](#2-routing)

Create `config/routes/cf_multi_view.yaml`:

```
cf_multi_view:
  resource: "@CfMultiViewBundle/Resources/config/routes.yaml"
  prefix: "/cf-stats"
```

If you have admin panel in your symfony application, you can add this route to your admin panel routes.

Usage &amp; Commands
--------------------

[](#usage--commands)

### 1. Domain Discovery

[](#1-domain-discovery)

Pull domains from all configured Cloudflare accounts:

```
php bin/console cf-multi-view:fetch-domains

# Or only for a specific account
php bin/console cf-multi-view:fetch-domains --account="Main Account"
```

This command populates the database and assigns each domain to its account group.

### 2. Synchronizing Statistics

[](#2-synchronizing-statistics)

```
# Sync all accounts, last 24h, with period depends on your subscription plan (Free: 1h)
php bin/console cf-multi-view:sync-stats --start="-24 hours" --period="1h"

# Sync with geographical data (Top 3 countries)
php bin/console cf-multi-view:sync-stats --with-countries

# Sync a specific account only
php bin/console cf-multi-view:sync-stats --account="Main Account" --with-countries
```

#### Options for `sync-stats`:

[](#options-for-sync-stats)

OptionDescriptionDefault`--period`Data granularity: `1m` (Enterprise), `1h`, `1d``1h``--start`Start of the range`-25 hours``--end`End of the range`now``--with-countries`Fetch Top 3 country breakdownoff`--account`Sync only a specific accountall#### Recommended CRON:

[](#recommended-cron)

```
*/5 * * * * php bin/console cf-multi-view:sync-stats --start="-2 hours" --with-countries > /dev/null 2>&1
```

### 3. Data Cleanup

[](#3-data-cleanup)

#### Delete old statistics:

[](#delete-old-statistics)

```
# Delete stats older than 90 days (asks for confirmation)
php bin/console cf-multi-view:purge-stats --older-than="90 days"

# Skip confirmation
php bin/console cf-multi-view:purge-stats --older-than="3 months" --force
```

#### Delete an entire account and all its data:

[](#delete-an-entire-account-and-all-its-data)

```
# Asks for confirmation
php bin/console cf-multi-view:delete-account --name="Staging Account"

# Skip confirmation
php bin/console cf-multi-view:delete-account --name="Staging Account" --force
```

Requirements
------------

[](#requirements)

- PHP 8.1+
- Symfony 5.4+
- Doctrine ORM
- Cloudflare API Token with the following permissions:
    - `Zone.Zone: Read`
    - `Zone.Analytics: Read`

Translations
------------

[](#translations)

The bundle supports multiple languages out of the box for both the dashboard and CLI commands:

LanguageCodeEnglish`en`Polish`pl`French`fr`German`de`Spanish`es`Italian`it`Czech`cs`Swedish`sv`Security
--------

[](#security)

The dashboard is protected by a password defined in your configuration. By default, the bundle includes:

- **CSRF Protection**: Form tokens to prevent cross-site request forgery.
- **Honeypot**: Hidden fields to automatically reject bot attempts.

### Advanced IP Protection (Optional)

[](#advanced-ip-protection-optional)

If you require IP-level protection (e.g., blocking an IP address after 5 failed attempts), we recommend using the standard Symfony `rate-limiter` component in your main application and targeting the `cf_multi_view_login` route.

Contributing
------------

[](#contributing)

Contributions are welcome! Please read the contributing guide `CONTRIBUTING.md` for details about our code of conduct, and the process for submitting pull requests to us.

Credits
-------

[](#credits)

Created by [Michał Kanak](https://github.com/michallkanak)

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance94

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~22 days

Total

2

Last Release

29d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35bdeeb4e748dac6cbbc8369be22264af99743a23bb39c033b760385663a6dc1?d=identicon)[michal.kanak](/maintainers/michal.kanak)

---

Top Contributors

[![michallkanak](https://avatars.githubusercontent.com/u/12290176?v=4)](https://github.com/michallkanak "michallkanak (6 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/michallkanak-symfony-cloudflare-multi-view/health.svg)

```
[![Health](https://phpackages.com/badges/michallkanak-symfony-cloudflare-multi-view/health.svg)](https://phpackages.com/packages/michallkanak-symfony-cloudflare-multi-view)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M370](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M195](/packages/sulu-sulu)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M710](/packages/sylius-sylius)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M506](/packages/shopware-core)[chameleon-system/chameleon-base

The Chameleon System core.

1027.9k4](/packages/chameleon-system-chameleon-base)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k16.8k](/packages/prestashop-prestashop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
