diff --git a/src/Controllers/ApiController.php b/src/Controllers/ApiController.php index f4ed5f2..368cd40 100644 --- a/src/Controllers/ApiController.php +++ b/src/Controllers/ApiController.php @@ -14,7 +14,8 @@ class ApiController implements ControllerInterface public function show( ZermeloReport $report ) { $presenter = new CardPresenter( $report ); - $presenter->setApiPrefix( api_prefix() ); + $api_prefix = trim( config("zermelo.URI_API_PREFIX"), "/ " ); + $presenter->setApiPrefix( $api_prefix ); $presenter->setReportPath( config('zermelobladecard.TABULAR_URI_PREFIX') ); $presenter->setSummaryPath( config('zermelobladecard.SUMMARY_URI_PREFIX') ); $cache = new DatabaseCache( $report ); @@ -24,7 +25,8 @@ public function show( ZermeloReport $report ) public function prefix() : string { - $prefix = api_prefix()."/".config('zermelobladecard.TABULAR_URI_PREFIX', "" ); + $api_prefix = trim( config("zermelo.URI_API_PREFIX"), "/ " ); + $prefix = $api_prefix."/".config('zermelobladecard.TABULAR_URI_PREFIX', "" ); return $prefix; } } diff --git a/src/Controllers/SummaryController.php b/src/Controllers/SummaryController.php index dc1ada0..439a118 100644 --- a/src/Controllers/SummaryController.php +++ b/src/Controllers/SummaryController.php @@ -18,7 +18,8 @@ public function show( ZermeloReport $report ) public function prefix() : string { - $prefix = api_prefix()."/".config('zermelobladecard.SUMMARY_URI_PREFIX', "" ); + $api_prefix = trim( config("zermelo.URI_API_PREFIX"), "/ " ); + $prefix = $api_prefix."/".config('zermelobladecard.SUMMARY_URI_PREFIX', "" ); return $prefix; } } diff --git a/src/Controllers/WebController.php b/src/Controllers/WebController.php index 72b1de4..d1677ee 100644 --- a/src/Controllers/WebController.php +++ b/src/Controllers/WebController.php @@ -14,7 +14,8 @@ public function show( ZermeloReport $report ) { $presenter = new CardPresenter( $report ); - $presenter->setApiPrefix( api_prefix() ); + $api_prefix = trim( config("zermelo.URI_API_PREFIX"), "/ " ); + $presenter->setApiPrefix( $api_prefix ); $presenter->setReportPath( config('zermelobladecard.TABULAR_URI_PREFIX', '') ); $presenter->setSummaryPath( config('zermelobladecard.SUMMARY_URI_PREFIX', '') );