Skip to content

charlielangridge/FathomStatsDisplay

Repository files navigation

Fathom Stats Display

A Laravel Nova Card to show Fathom Analytics stats.

Status License PHP Latest Version on Packagist Downloads


Table of Contents

Getting Started

You'll need a Fathom account - if you don't have one, feel free to use our referal code: https://usefathom.com/ref/BYODNP - you'll get $10 off your first invoice and we get a little something too

Prerequisites

This package requires the following :

  • PHP 8.0 or higher
  • Laravel Nova 4.0 or higher
  • Fathom account with API access

Installing

To get started, you will need to install the following dependencies :

composer require charlielangridge/fathom-stats-display

Next add your Fathom API Token and Site ID to your .env file

FATHOM_SITE_ID=
FATHOM_TOKEN=

That's it, you're ready to go!

Usage

Add the card to any of your dashboards

<?php

namespace App\Nova\Dashboards;

use CharlieLangridge\FathomStatsDisplay\FathomStatsDisplay;
use Laravel\Nova\Dashboards\Main as Dashboard;

class Main extends Dashboard
{
    /**
     * Get the cards for the dashboard.
     *
     * @return array
     */
    public function cards()
    {
        return [
            new FathomStatsDisplay,
        ];
    }
}

Stats are cached for an hour, but can be refreshed with the on-card link. The time period for the stats is selectable with the drop-down.

Authors

License

The MIT License (MIT). Please see License File for more information.