Skip to content
This repository has been archived by the owner on Mar 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #64 from jedesign/feature/disableAugmentationForPl…
Browse files Browse the repository at this point in the history
…ainLaravel

Return regular view data if a route is not served by Statamic
  • Loading branch information
edalzell authored Oct 1, 2021
2 parents 8d741f3 + 6790c2f commit 8575ed9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Augmentation/AugmentedView.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public function gatherData(): array
{
$variables = parent::gatherData();

if (!$this->isRouteServedByStatamic($variables)) {
return $variables;
}

if (Statamic::isCpRoute()) {
return $variables;
}
Expand All @@ -22,4 +26,9 @@ public function gatherData(): array
return $this->getAugmentedValue($data);
}, $variables);
}

private function isRouteServedByStatamic(array $variables): bool
{
return isset($variables['cp_url']);
}
}

0 comments on commit 8575ed9

Please sign in to comment.