diff --git a/src/Composers/SeoComposer.php b/src/Composers/SeoComposer.php index fcc7435..c3d6eb8 100644 --- a/src/Composers/SeoComposer.php +++ b/src/Composers/SeoComposer.php @@ -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( @@ -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();