Files
omg-wtf-ai/app/Providers/AppServiceProvider.php
T

36 lines
951 B
PHP
Raw Normal View History

2026-08-08 18:03:29 +03:00
<?php
namespace App\Providers;
use App\Models\Page;
2026-08-09 04:19:21 +03:00
use Illuminate\Support\Facades\URL;
2026-08-08 18:03:29 +03:00
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
2026-08-09 04:19:21 +03:00
// 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'));
2026-08-08 18:03:29 +03:00
View::composer('components.layouts.app', function ($view) {
$view->with('footerPages', Page::published()->inFooter()->get());
});
}
}