Skip to content

Commit

Permalink
Merge pull request #16 from Tschucki/self-hosted-plausible
Browse files Browse the repository at this point in the history
Add base_url to config for using self hosted plausible
  • Loading branch information
njoguamos authored Apr 7, 2024
2 parents 6659192 + a105553 commit eb70d25
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions config/plausible.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
<?php

return [
/*
|--------------------------------------------------------------------------
| Base URL
|--------------------------------------------------------------------------
|
| Each request requires a base url which is by default the official
| base url of Plausible.
|
|
*/
'base_url' => env(key: 'PLAUSIBLE_BASE_URL', default: 'https://plausible.io/api/v1/stats'),

/*
|--------------------------------------------------------------------------
| Site ID (Domain)
Expand Down
2 changes: 1 addition & 1 deletion src/Connectors/PlausibleConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct()

public function resolveBaseUrl(): string
{
return 'https://plausible.io/api/v1/stats';
return config(key: 'plausible.base_url');
}

public function defaultConfig(): array
Expand Down

0 comments on commit eb70d25

Please sign in to comment.