From fd2fea478f4ef1a164e47385f8887e4972155788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogus=C5=82aw=20Witek?= Date: Sun, 12 Oct 2025 17:36:07 +0200 Subject: [PATCH] Add umami analytics --- .env.example | 4 +++- config/services.php | 5 +++++ resources/js/layouts/AppLayout.tsx | 10 +++------- resources/views/app.blade.php | 4 ++++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index 9e3dfdf..27ba8e2 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,8 @@ APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost +UMAMI_SRC= +UMAMI_WEBSITE_ID= APP_LOCALE=en APP_FALLBACK_LOCALE=en @@ -62,4 +64,4 @@ AWS_DEFAULT_REGION=us-east-1 AWS_BUCKET= AWS_USE_PATH_STYLE_ENDPOINT=false -VITE_APP_NAME="${APP_NAME}" +VITE_APP_NAME="${APP_NAME}" \ No newline at end of file diff --git a/config/services.php b/config/services.php index 27a3617..8527392 100644 --- a/config/services.php +++ b/config/services.php @@ -35,4 +35,9 @@ return [ ], ], + 'umami' => [ + 'src' => env('UMAMI_SRC'), + 'website_id' => env('UMAMI_WEBSITE_ID'), + ], + ]; diff --git a/resources/js/layouts/AppLayout.tsx b/resources/js/layouts/AppLayout.tsx index d38f327..88574f7 100644 --- a/resources/js/layouts/AppLayout.tsx +++ b/resources/js/layouts/AppLayout.tsx @@ -1,13 +1,9 @@ import { type ReactNode } from 'react'; -import { Head } from '@inertiajs/react'; interface AppLayoutProps { children: ReactNode; } -export default ({ children }: AppLayoutProps) => -(<> - - - {children} -); +export default ({ children }: AppLayoutProps) => { + return <>{children}; +}; diff --git a/resources/views/app.blade.php b/resources/views/app.blade.php index 518ec48..1228dfb 100644 --- a/resources/views/app.blade.php +++ b/resources/views/app.blade.php @@ -24,6 +24,10 @@ @viteReactRefresh @vite(['resources/js/app.tsx', "resources/js/pages/{$page['component']}.tsx"]) @inertiaHead + + @if(config('services.umami.src') && config('services.umami.website_id')) + + @endif @inertia