refactor(views): update canonical URL generation logic

Refactored the canonical URL generation logic in the app.blade.php file to use Laravel's url() helper function instead of accessing $_SERVER directly.
This commit is contained in:
Rico van Zelst
2024-03-03 18:11:09 +01:00
parent 9ad6d1e091
commit d8082b4db8

View File

@@ -23,11 +23,11 @@
<title>@yield('title')</title> <title>@yield('title')</title>
<meta name="description" content="@yield('description')"> <meta name="description" content="@yield('description')">
{{-- @if (strpos($_SERVER['REQUEST_URI'], 'page') !== false) @if (strpos(url()->full(), 'page') !== false)
<link rel="canonical" href="{{ url()->full() }}"> <link rel="canonical" href="{{ url()->full() }}">
@else @else
<link rel="canonical" href="{{ url()->current() }}"> <link rel="canonical" href="{{ url()->current() }}">
@endif --}} @endif
@stack('meta_tags') @stack('meta_tags')