seo fixes

This commit is contained in:
2026-08-09 04:19:21 +03:00
parent df2128ebff
commit bed4c48900
19 changed files with 368 additions and 25 deletions
+7
View File
@@ -3,6 +3,7 @@
namespace App\Providers;
use App\Models\Page;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
@@ -21,6 +22,12 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(): void
{
// Always generate absolute URLs (route(), url(), canonical tags, sitemap,
// JSON-LD, ...) from the configured APP_URL, not the incoming request's
// Host header. Without this, www vs apex requests each produce
// self-referencing canonical URLs for identical content.
URL::forceRootUrl(config('app.url'));
View::composer('components.layouts.app', function ($view) {
$view->with('footerPages', Page::published()->inFooter()->get());
});