36 lines
951 B
PHP
36 lines
951 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\Page;
|
|
use Illuminate\Support\Facades\URL;
|
|
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
|
|
{
|
|
// 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());
|
|
});
|
|
}
|
|
}
|