Add pageview logging via PostHog

This commit is contained in:
Frankie B 2024-06-11 21:36:58 +01:00
commit 0f4da7e3df
7 changed files with 114 additions and 14 deletions

View file

@ -2,23 +2,27 @@
namespace App\Providers;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\ServiceProvider;
use PostHog\PostHog;
class AppServiceProvider extends ServiceProvider
{
class AppServiceProvider extends ServiceProvider {
/**
* Register any application services.
*/
public function register(): void
{
public function register(): void {
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
public function boot(): void {
PostHog::init(
Config::get('services.posthog.key'),
[
'host' => 'https://'.Config::get('services.posthog.host')
]
);
}
}