'/', 'priority' => '1.0', 'changefreq' => 'weekly'],
['path' => '/trainings', 'priority' => '0.9', 'changefreq' => 'weekly'],
['path' => '/privacy', 'priority' => '0.3', 'changefreq' => 'monthly'],
['path' => '/terms', 'priority' => '0.3', 'changefreq' => 'monthly'],
];
public function sitemap(): Response
{
$base = 'https://koulutus.sampo.pro';
$today = now()->toDateString();
$xml = '' . "\n";
$xml .= '' . "\n";
foreach ($this->pages as $page) {
foreach ($this->locales as $locale) {
$loc = $base . '/' . $locale . $page['path'];
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$today}\n";
$xml .= " {$page['changefreq']}\n";
$xml .= " {$page['priority']}\n";
foreach ($this->locales as $lang) {
$href = $base . '/' . $lang . $page['path'];
$xml .= " \n";
}
$xml .= " \n";
$xml .= " \n";
}
}
$blogPosts = \App\Models\BlogPost::published()->get();
foreach ($blogPosts as $post) {
foreach ($this->locales as $locale) {
$slug = $post->getTranslation('slug', $locale, false);
if (!$slug) continue;
$loc = $base . '/' . $locale . '/blog/' . $slug;
$lastmod = $post->published_at?->toDateString() ?? $today;
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$lastmod}\n";
$xml .= " monthly\n";
$xml .= " 0.6\n";
foreach ($this->locales as $lang) {
$slugLang = $post->getTranslation('slug', $lang, false);
if (!$slugLang) continue;
$href = $base . '/' . $lang . '/blog/' . $slugLang;
$xml .= " \n";
}
$xml .= " getTranslation('slug', 'en', false)}\"/>\n";
$xml .= " \n";
}
}
$xml .= '';
return response($xml, 200, ['Content-Type' => 'application/xml']);
}
}
'/', 'priority' => '1.0', 'changefreq' => 'weekly'],
['path' => '/trainings', 'priority' => '0.9', 'changefreq' => 'weekly'],
['path' => '/privacy', 'priority' => '0.3', 'changefreq' => 'monthly'],
['path' => '/terms', 'priority' => '0.3', 'changefreq' => 'monthly'],
];
public function sitemap(): Response
{
$base = 'https://koulutus.sampo.pro';
$today = now()->toDateString();
$xml = '' . "\n";
$xml .= '' . "\n";
foreach ($this->pages as $page) {
foreach ($this->locales as $locale) {
$loc = $base . '/' . $locale . $page['path'];
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$today}\n";
$xml .= " {$page['changefreq']}\n";
$xml .= " {$page['priority']}\n";
foreach ($this->locales as $lang) {
$href = $base . '/' . $lang . $page['path'];
$xml .= " \n";
}
$xml .= " \n";
$xml .= " \n";
}
}
$blogPosts = \App\Models\BlogPost::published()->get();
foreach ($blogPosts as $post) {
foreach ($this->locales as $locale) {
$slug = $post->getTranslation('slug', $locale, false);
if (!$slug) continue;
$loc = $base . '/' . $locale . '/blog/' . $slug;
$lastmod = $post->published_at?->toDateString() ?? $today;
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$lastmod}\n";
$xml .= " monthly\n";
$xml .= " 0.6\n";
foreach ($this->locales as $lang) {
$slugLang = $post->getTranslation('slug', $lang, false);
if (!$slugLang) continue;
$href = $base . '/' . $lang . '/blog/' . $slugLang;
$xml .= " \n";
}
$xml .= " getTranslation('slug', 'en', false)}\"/>\n";
$xml .= " \n";
}
}
$xml .= '';
return response($xml, 200, ['Content-Type' => 'application/xml']);
}
}
'/', 'priority' => '1.0', 'changefreq' => 'weekly'],
['path' => '/trainings', 'priority' => '0.9', 'changefreq' => 'weekly'],
['path' => '/privacy', 'priority' => '0.3', 'changefreq' => 'monthly'],
['path' => '/terms', 'priority' => '0.3', 'changefreq' => 'monthly'],
];
public function sitemap(): Response
{
$base = 'https://koulutus.sampo.pro';
$today = now()->toDateString();
$xml = '' . "\n";
$xml .= '' . "\n";
foreach ($this->pages as $page) {
foreach ($this->locales as $locale) {
$loc = $base . '/' . $locale . $page['path'];
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$today}\n";
$xml .= " {$page['changefreq']}\n";
$xml .= " {$page['priority']}\n";
foreach ($this->locales as $lang) {
$href = $base . '/' . $lang . $page['path'];
$xml .= " \n";
}
$xml .= " \n";
$xml .= " \n";
}
}
$blogPosts = \App\Models\BlogPost::published()->get();
foreach ($blogPosts as $post) {
foreach ($this->locales as $locale) {
$slug = $post->getTranslation('slug', $locale, false);
if (!$slug) continue;
$loc = $base . '/' . $locale . '/blog/' . $slug;
$lastmod = $post->published_at?->toDateString() ?? $today;
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$lastmod}\n";
$xml .= " monthly\n";
$xml .= " 0.6\n";
foreach ($this->locales as $lang) {
$slugLang = $post->getTranslation('slug', $lang, false);
if (!$slugLang) continue;
$href = $base . '/' . $lang . '/blog/' . $slugLang;
$xml .= " \n";
}
$xml .= " getTranslation('slug', 'en', false)}\"/>\n";
$xml .= " \n";
}
}
$xml .= '';
return response($xml, 200, ['Content-Type' => 'application/xml']);
}
}
'/', 'priority' => '1.0', 'changefreq' => 'weekly'],
['path' => '/trainings', 'priority' => '0.9', 'changefreq' => 'weekly'],
['path' => '/privacy', 'priority' => '0.3', 'changefreq' => 'monthly'],
['path' => '/terms', 'priority' => '0.3', 'changefreq' => 'monthly'],
];
public function sitemap(): Response
{
$base = 'https://koulutus.sampo.pro';
$today = now()->toDateString();
$xml = '' . "\n";
$xml .= '' . "\n";
foreach ($this->pages as $page) {
foreach ($this->locales as $locale) {
$loc = $base . '/' . $locale . $page['path'];
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$today}\n";
$xml .= " {$page['changefreq']}\n";
$xml .= " {$page['priority']}\n";
foreach ($this->locales as $lang) {
$href = $base . '/' . $lang . $page['path'];
$xml .= " \n";
}
$xml .= " \n";
$xml .= " \n";
}
}
$blogPosts = \App\Models\BlogPost::published()->get();
foreach ($blogPosts as $post) {
foreach ($this->locales as $locale) {
$slug = $post->getTranslation('slug', $locale, false);
if (!$slug) continue;
$loc = $base . '/' . $locale . '/blog/' . $slug;
$lastmod = $post->published_at?->toDateString() ?? $today;
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$lastmod}\n";
$xml .= " monthly\n";
$xml .= " 0.6\n";
foreach ($this->locales as $lang) {
$slugLang = $post->getTranslation('slug', $lang, false);
if (!$slugLang) continue;
$href = $base . '/' . $lang . '/blog/' . $slugLang;
$xml .= " \n";
}
$xml .= " getTranslation('slug', 'en', false)}\"/>\n";
$xml .= " \n";
}
}
$xml .= '';
return response($xml, 200, ['Content-Type' => 'application/xml']);
}
}
'/', 'priority' => '1.0', 'changefreq' => 'weekly'],
['path' => '/trainings', 'priority' => '0.9', 'changefreq' => 'weekly'],
['path' => '/privacy', 'priority' => '0.3', 'changefreq' => 'monthly'],
['path' => '/terms', 'priority' => '0.3', 'changefreq' => 'monthly'],
];
public function sitemap(): Response
{
$base = 'https://koulutus.sampo.pro';
$today = now()->toDateString();
$xml = '' . "\n";
$xml .= '' . "\n";
foreach ($this->pages as $page) {
foreach ($this->locales as $locale) {
$loc = $base . '/' . $locale . $page['path'];
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$today}\n";
$xml .= " {$page['changefreq']}\n";
$xml .= " {$page['priority']}\n";
foreach ($this->locales as $lang) {
$href = $base . '/' . $lang . $page['path'];
$xml .= " \n";
}
$xml .= " \n";
$xml .= " \n";
}
}
$blogPosts = \App\Models\BlogPost::published()->get();
foreach ($blogPosts as $post) {
foreach ($this->locales as $locale) {
$slug = $post->getTranslation('slug', $locale, false);
if (!$slug) continue;
$loc = $base . '/' . $locale . '/blog/' . $slug;
$lastmod = $post->published_at?->toDateString() ?? $today;
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$lastmod}\n";
$xml .= " monthly\n";
$xml .= " 0.6\n";
foreach ($this->locales as $lang) {
$slugLang = $post->getTranslation('slug', $lang, false);
if (!$slugLang) continue;
$href = $base . '/' . $lang . '/blog/' . $slugLang;
$xml .= " \n";
}
$xml .= " getTranslation('slug', 'en', false)}\"/>\n";
$xml .= " \n";
}
}
$xml .= '';
return response($xml, 200, ['Content-Type' => 'application/xml']);
}
}
'/', 'priority' => '1.0', 'changefreq' => 'weekly'],
['path' => '/trainings', 'priority' => '0.9', 'changefreq' => 'weekly'],
['path' => '/privacy', 'priority' => '0.3', 'changefreq' => 'monthly'],
['path' => '/terms', 'priority' => '0.3', 'changefreq' => 'monthly'],
];
public function sitemap(): Response
{
$base = 'https://koulutus.sampo.pro';
$today = now()->toDateString();
$xml = '' . "\n";
$xml .= '' . "\n";
foreach ($this->pages as $page) {
foreach ($this->locales as $locale) {
$loc = $base . '/' . $locale . $page['path'];
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$today}\n";
$xml .= " {$page['changefreq']}\n";
$xml .= " {$page['priority']}\n";
foreach ($this->locales as $lang) {
$href = $base . '/' . $lang . $page['path'];
$xml .= " \n";
}
$xml .= " \n";
$xml .= " \n";
}
}
$blogPosts = \App\Models\BlogPost::published()->get();
foreach ($blogPosts as $post) {
foreach ($this->locales as $locale) {
$slug = $post->getTranslation('slug', $locale, false);
if (!$slug) continue;
$loc = $base . '/' . $locale . '/blog/' . $slug;
$lastmod = $post->published_at?->toDateString() ?? $today;
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$lastmod}\n";
$xml .= " monthly\n";
$xml .= " 0.6\n";
foreach ($this->locales as $lang) {
$slugLang = $post->getTranslation('slug', $lang, false);
if (!$slugLang) continue;
$href = $base . '/' . $lang . '/blog/' . $slugLang;
$xml .= " \n";
}
$xml .= " getTranslation('slug', 'en', false)}\"/>\n";
$xml .= " \n";
}
}
$xml .= '';
return response($xml, 200, ['Content-Type' => 'application/xml']);
}
}
'/', 'priority' => '1.0', 'changefreq' => 'weekly'],
['path' => '/trainings', 'priority' => '0.9', 'changefreq' => 'weekly'],
['path' => '/privacy', 'priority' => '0.3', 'changefreq' => 'monthly'],
['path' => '/terms', 'priority' => '0.3', 'changefreq' => 'monthly'],
];
public function sitemap(): Response
{
$base = 'https://koulutus.sampo.pro';
$today = now()->toDateString();
$xml = '' . "\n";
$xml .= '' . "\n";
foreach ($this->pages as $page) {
foreach ($this->locales as $locale) {
$loc = $base . '/' . $locale . $page['path'];
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$today}\n";
$xml .= " {$page['changefreq']}\n";
$xml .= " {$page['priority']}\n";
foreach ($this->locales as $lang) {
$href = $base . '/' . $lang . $page['path'];
$xml .= " \n";
}
$xml .= " \n";
$xml .= " \n";
}
}
$blogPosts = \App\Models\BlogPost::published()->get();
foreach ($blogPosts as $post) {
foreach ($this->locales as $locale) {
$slug = $post->getTranslation('slug', $locale, false);
if (!$slug) continue;
$loc = $base . '/' . $locale . '/blog/' . $slug;
$lastmod = $post->published_at?->toDateString() ?? $today;
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$lastmod}\n";
$xml .= " monthly\n";
$xml .= " 0.6\n";
foreach ($this->locales as $lang) {
$slugLang = $post->getTranslation('slug', $lang, false);
if (!$slugLang) continue;
$href = $base . '/' . $lang . '/blog/' . $slugLang;
$xml .= " \n";
}
$xml .= " getTranslation('slug', 'en', false)}\"/>\n";
$xml .= " \n";
}
}
$xml .= '';
return response($xml, 200, ['Content-Type' => 'application/xml']);
}
}
'/', 'priority' => '1.0', 'changefreq' => 'weekly'],
['path' => '/trainings', 'priority' => '0.9', 'changefreq' => 'weekly'],
['path' => '/privacy', 'priority' => '0.3', 'changefreq' => 'monthly'],
['path' => '/terms', 'priority' => '0.3', 'changefreq' => 'monthly'],
];
public function sitemap(): Response
{
$base = 'https://koulutus.sampo.pro';
$today = now()->toDateString();
$xml = '' . "\n";
$xml .= '' . "\n";
foreach ($this->pages as $page) {
foreach ($this->locales as $locale) {
$loc = $base . '/' . $locale . $page['path'];
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$today}\n";
$xml .= " {$page['changefreq']}\n";
$xml .= " {$page['priority']}\n";
foreach ($this->locales as $lang) {
$href = $base . '/' . $lang . $page['path'];
$xml .= " \n";
}
$xml .= " \n";
$xml .= " \n";
}
}
$blogPosts = \App\Models\BlogPost::published()->get();
foreach ($blogPosts as $post) {
foreach ($this->locales as $locale) {
$slug = $post->getTranslation('slug', $locale, false);
if (!$slug) continue;
$loc = $base . '/' . $locale . '/blog/' . $slug;
$lastmod = $post->published_at?->toDateString() ?? $today;
$xml .= " \n";
$xml .= " {$loc}\n";
$xml .= " {$lastmod}\n";
$xml .= " monthly\n";
$xml .= " 0.6\n";
foreach ($this->locales as $lang) {
$slugLang = $post->getTranslation('slug', $lang, false);
if (!$slugLang) continue;
$href = $base . '/' . $lang . '/blog/' . $slugLang;
$xml .= " \n";
}
$xml .= " getTranslation('slug', 'en', false)}\"/>\n";
$xml .= " \n";
}
}
$xml .= '';
return response($xml, 200, ['Content-Type' => 'application/xml']);
}
}
Server Error