PHPackages                             afsanalytics/dashboard - 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. [Admin Panels](/categories/admin)
4. /
5. afsanalytics/dashboard

ActiveProject[Admin Panels](/categories/admin)

afsanalytics/dashboard
======================

AFS Analytics embedded dashboard

00PHP

Since Feb 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/AFSAnalytics/embedded-dashboard-php)[ Packagist](https://packagist.org/packages/afsanalytics/dashboard)[ RSS](/packages/afsanalytics-dashboard/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

AFS Analytics embedded dashboard
================================

[](#afs-analytics-embedded-dashboard)

This PHP Module allows you to embed AFS Analytics dashboard in your admin with just a few lines of code.

Install
-------

[](#install)

```
composer require afsanalytics/dashboard

```

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

[](#requirements)

PHP &gt;= 7.0

Getting started
---------------

[](#getting-started)

### Introduction

[](#introduction)

Please note that the page displaying AFS Analytics dashboard **should not** be public -- unless you want your stats to be public.

### Displaying the Dashboard

[](#displaying-the-dashboard)

Including the dashboard on a page is done by creating a container element, and then calling the render method.

```
print '';

$db = new \AFSAnalytics\Dashboard\Controller( YOUR_API_KEY );
$db->setParentSelector('#my_custom_id')
   ->render()
;
```

### Running the Ajax Server

[](#running-the-ajax-server)

In addition to inserting the code displaying the dashboard, you need to run the ajax server responsible for calling AFS Analytics REST API.

This can be done with just two lines of codes:

```
$db = new \AFSAnalytics\Dashboard\Controller( YOUR_API_KEY );
$db->runAJAXServer();
```

This code can be inserted on the same page, or on a separate one. In either case it **must be** placed before any outpout.

### Passing data to the Ajax Server

[](#passing-data-to-the-ajax-server)

In order to secure access to the Ajax Server, you might want to add some custom data to all Ajax calls.

You can do this via javascript:

```
AFSA.hook.prepareAjaxData = function (data) {
				data.my_property = my_value;
			};
```

### Obtaining an API Key

[](#obtaining-an-api-key)

You can create an API Key at [https://dev.afsanalytics.com](https://dev.afsanalytics.com/en/manage/api/keys.php)

Please note that a valid AFS Analytics account will be required, as a subscription including API Access.

### Methods of interest

[](#methods-of-interest)

#### setParentSelector($selector)

[](#setparentselectorselector)

Embed the dashboard inside the specified selector.

#### render( $options = \[\] )

[](#render-options---)

Return the dashboard HTML code.

```
$db ->setParentSelector('#my_custom_id')
    ->render([
        'css' => string // custom css to be inserted - optional
        ])
```

#### disableECommerce()

[](#disableecommerce)

Disable all eCommerce related reports.

### setLangage( $lng )

[](#setlangage-lng-)

Set dashboard langage.

Currently supported $lng values : 'en', 'fr'

Changelog
---------

[](#changelog)

See the [project changelog](./CHANGELOG.md)

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

[](#contributing)

Contributions are always welcome.

Support
-------

[](#support)

Please email `dev@afsanalytics.com`.

License
-------

[](#license)

This package is released under the MIT License. See the bundled [LICENSE](./LICENSE) file for details.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f4429415a8af63f2e9b9a805206644fc682e2482a10f0f8787936993aec4f405?d=identicon)[AFSAnalytics](/maintainers/AFSAnalytics)

---

Top Contributors

[![JM-AFSAnalytics](https://avatars.githubusercontent.com/u/61923241?v=4)](https://github.com/JM-AFSAnalytics "JM-AFSAnalytics (4 commits)")

### Embed Badge

![Health badge](/badges/afsanalytics-dashboard/health.svg)

```
[![Health](https://phpackages.com/badges/afsanalytics-dashboard/health.svg)](https://phpackages.com/packages/afsanalytics-dashboard)
```

###  Alternatives

[jeroennoten/laravel-adminlte

Easy AdminLTE integration with Laravel

4.0k4.8M43](/packages/jeroennoten-laravel-adminlte)[dmstr/yii2-adminlte-asset

AdminLTE backend theme asset bundle for Yii 2.0 Framework

1.1k1.8M67](/packages/dmstr-yii2-adminlte-asset)[dwij/laraadmin

LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like CRUD Generation, Module Manager, Media, Menus, Backups and much more

1.6k68.7k](/packages/dwij-laraadmin)[filament/spatie-laravel-media-library-plugin

Filament support for `spatie/laravel-medialibrary`.

1764.8M125](/packages/filament-spatie-laravel-media-library-plugin)[bezhansalleh/filament-exceptions

A Simple &amp; Beautiful Pluggable Exception Viewer for FilamentPHP's Admin Panel

193195.9k13](/packages/bezhansalleh-filament-exceptions)[filament/infolists

Easily add beautiful read-only infolists to any Livewire component.

1220.8M36](/packages/filament-infolists)

PHPackages © 2026

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