From e89a7bb329abf3cd252fea7f624acbc454d7caf4 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Tue, 11 Jun 2024 21:36:58 +0100 Subject: Add pageview logging via PostHog --- app/Providers/AppServiceProvider.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'app/Providers') diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 452e6b6..3aa155c 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -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') + ] + ); } } -- cgit v1.2.3-54-g00ecf