PHPackages                             devlogx/filament-pirsch-dashboard-widget - 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. devlogx/filament-pirsch-dashboard-widget

ActiveLibrary[Admin Panels](/categories/admin)

devlogx/filament-pirsch-dashboard-widget
========================================

This is my package filament-pirsch-dashboard-widget

1.1.1(2y ago)5225MITPHPPHP ^8.1|^8.2|^8.3

Since May 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/devlogx/filament-pirsch-dashboard-widget)[ Packagist](https://packagist.org/packages/devlogx/filament-pirsch-dashboard-widget)[ Docs](https://github.com/devlogx/filament-pirsch-dashboard-widget)[ GitHub Sponsors](https://github.com/devlogx)[ RSS](/packages/devlogx-filament-pirsch-dashboard-widget/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (14)Versions (4)Used By (0)

  ![XtendLaravel](https://raw.githubusercontent.com/devlogx/filament-pirsch-dashboard-widget/main/art/FilamentPirschWidget.png)Filament Pirsch Dashboard Widget
================================

[](#filament-pirsch-dashboard-widget)

[![Latest Version on Packagist](https://camo.githubusercontent.com/57b77330ba3b90305cf491ea6e741fcebbb23524392e733c95b94f5304b404dc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465766c6f67782f66696c616d656e742d7069727363682d64617368626f6172642d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devlogx/filament-pirsch-dashboard-widget)[![GitHub Tests Action Status](https://camo.githubusercontent.com/ed21cc14ecdc8f3f21d492657c40b6d3cf2b21abec302bbc53e86ec2b26b2393/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6465766c6f67782f66696c616d656e742d7069727363682d64617368626f6172642d7769646765742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/devlogx/filament-pirsch-dashboard-widget/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/ddec9527592f27b714032bf1464e2471a539d225e994e7fa8793130df6f7f43f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6465766c6f67782f66696c616d656e742d7069727363682d64617368626f6172642d7769646765742f6669782d7068702d636f64652d7374796c696e672e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/devlogx/filament-pirsch-dashboard-widget/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ceb0753b99fe850ee2a9c3f8c76370421b432aed4acbc949dfe7836465c8b017/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465766c6f67782f66696c616d656e742d7069727363682d64617368626f6172642d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devlogx/filament-pirsch-dashboard-widget)

This package allows you to integrate a simple analytics dashboard widget for panel.

Screenshots
-----------

[](#screenshots)

[![filament_pirsch_light.jpg](https://raw.githubusercontent.com/devlogx/filament-pirsch-dashboard-widget/main/art/filament_pirsch_light.jpg)](https://raw.githubusercontent.com/devlogx/filament-pirsch-dashboard-widget/main/art/filament_pirsch_light.jpg)[![filament_pirsch_dark.jpg](https://raw.githubusercontent.com/devlogx/filament-pirsch-dashboard-widget/main/art/filament_pirsch_dark.jpg)](https://raw.githubusercontent.com/devlogx/filament-pirsch-dashboard-widget/main/art/filament_pirsch_dark.jpg)

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

[](#installation)

You can install the package via composer:

```
composer require devlogx/filament-pirsch-dashboard-widget
```

Get the Pirsch access token and add it your `env` file.

1. Visit the [Pirsch "Integration" settings page](https://dashboard.pirsch.io/settings/integration).
2. Make sure the correct domain is selected in the top left corner of the page.
3. Scroll down to the "Clients" section and press the "Add Client" button.
4. Select "oAuth (ID + secret)" as type and enter a description.
5. Press the "Create Client" button and copy the generated "Client id and Client secret".
6. Add the copied id and secret to your `.env` file:

```
# ...
PIRSCH_CLIENT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PIRSCH_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

You can publish the config file with:

```
php artisan vendor:publish --tag="filament-pirsch-dashboard-widget-config"
```

Optionally, you can publish the translations using

```
php artisan vendor:publish --tag="filament-pirsch-dashboard-widget-translations"
```

This is the contents of the published config file:

```
return [
    /*
    |--------------------------------------------------------------------------
    | Pirsch Client id & Client secret
    |--------------------------------------------------------------------------
    |
    | You can acquire your client id and secret id under
    | https://dashboard.pirsch.io/settings/integration
    |
    */
    'client_id' => env('PIRSCH_CLIENT_ID', null),
    'client_secret' => env('PIRSCH_CLIENT_SECRET', null),

    /*
    |--------------------------------------------------------------------------
    | Stats cache ttl
    |--------------------------------------------------------------------------
    |
    | This value is the ttl for the displayed dashboard
    | stats values. You can increase or decrease
    | this value.
    |
    */
    'cache_time' => 300,
];
```

Usage
-----

[](#usage)

### Create own Dashboard file

[](#create-own-dashboard-file)

Under `Filament/Pages/` create a new file called `Dashboard.php` with following contents:

```
