diff --git a/src/Middleware/AddSeoMetaTagDefaults.php b/src/Middleware/AddSeoMetaTagDefaults.php new file mode 100644 index 0000000..ba88ea2 --- /dev/null +++ b/src/Middleware/AddSeoMetaTagDefaults.php @@ -0,0 +1,41 @@ +title(config('app.name')); + seo()->description(config('app.name')); + + // can't be overridden + seo()->meta('theme-color', '#ffffff'); + seo()->add(Meta::make()->attr('name', 'manifest')->attr('href', asset('site.webmanifest'))); + + seo()->canonical(url()->current()); + + seo()->og('locale', app()->getLocale()); + seo()->og('site_name', config('app.name')); + seo()->og('type', 'website'); + seo()->og('url', url()->current()); + + // can't be overridden + seo()->add(Link::make()->href(url()->current())->rel('alternate')->attr('hreflang', 'x-default')); + + seo()->og('locale', app()->getLocale()); + seo()->og('site_name', config('app.name')); + seo()->og('type', 'website'); + seo()->og('url', url()->current()); + + seo()->og('image', 'https://via.placeholder.com/1200x630.png?text='.urlencode(config('app.name'))); + seo()->og('image:alt', config('app.name')); + + return $next($request); + } +}