Skip to content

Commit e95f00c

Browse files
committed
Add Fathom Analytics configuration and integrate script in guest layout
1 parent 3b85603 commit e95f00c

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,5 @@ GITHUB_CLIENT_SECRET=
7575

7676
SENTRY_LARAVEL_DSN=
7777
SENTRY_TRACES_SAMPLE_RATE=1.0
78+
79+
FATHOM_ANALYTICS_SITE_ID=

app/Providers/AppServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ private function configureModels(): void
4545
{
4646
Model::unguard();
4747
Model::shouldBeStrict(! $this->app->isProduction());
48+
// Model::automaticallyEagerLoadRelationships();
4849

4950
Relation::enforceMorphMap([
5051
'team' => Team::class,

config/services.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,7 @@
4949
'redirect' => '/auth/callback/github',
5050
],
5151

52+
'fathom' => [
53+
'site_id' => env('FATHOM_ANALYTICS_SITE_ID'),
54+
]
5255
];

resources/views/layouts/guest.blade.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@props(['title'])
22

3-
<!DOCTYPE html>
3+
<!DOCTYPE html>
44
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
55
<head>
66
<meta charset="utf-8">
@@ -20,15 +20,21 @@
2020

2121
<!-- Font Awesome for icons -->
2222
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
23+
24+
@if(app()->isProduction() && !empty(config('services.fathom.site_id')))
25+
<!-- Fathom - beautiful, simple website analytics -->
26+
<script src="https://cdn.usefathom.com/script.js" data-site="{{ config('services.fathom.site_id') }}" defer></script>
27+
<!-- / Fathom -->
28+
@endif
2329
</head>
2430
<body class="antialiased text-gray-800">
2531

26-
<x-layout.header />
32+
<x-layout.header/>
2733

2834
<!-- Main Content -->
2935
{{ $slot }}
3036

31-
<x-layout.footer />
37+
<x-layout.footer/>
3238

3339
@livewireScripts
3440
</body>

0 commit comments

Comments
 (0)