panphp/pan

Show analytics data to the browser instead terminal

Closed this issue ยท 3 comments

Hello,

There is no documentation about how to show analytics data in the dashboard. I mean I want to see those data in the dashboard. Currently I saw there is one method and which is terminal. How to do that? any idea?

I will work on it once @nunomaduro releases the update with the publishing configuration. I had a PR made but retracted that for the same reason.

You can always get the values directly from the database using the DB facade or create an Eloquent model and create your view to display the information. ๐Ÿคทโ€โ™‚๏ธ

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Analytics extends Model
{
    protected $table = 'pan_analytics';
}

if you want to do it in your project

use Pan\Contracts\AnalyticsRepository;

// Use this in your controller via dependency injection. 
AnalyticsRepository $analytics

// This will give you all the data array.
$analytics = $analytics->all();