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

Commit

Permalink
move request path after model instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-rubel committed Jan 8, 2022
1 parent 5363adc commit ecf7196
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Composers/SeoComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ public function compose(View $view): void
*/
protected function getSeoTags(): mixed
{
$nonPrefixedUrl = request()->path();

$url = Str::start(
$nonPrefixedUrl,
'/'
);

$configuredModel = config('seo-manager.model');

$model = app(
Expand All @@ -67,6 +60,9 @@ protected function getSeoTags(): mixed
throw new ShouldImplementSeoTagInterfaceException();
}

$nonPrefixedUrl = request()->path();
$url = Str::start($nonPrefixedUrl, '/');

$instance = $model::where($model->getUrlColumnName(), $url)
->orWhere($model->getUrlColumnName(), $nonPrefixedUrl)
->first();
Expand Down

0 comments on commit ecf7196

Please sign in to comment.