Initial commit
This commit is contained in:
21
resources/views/sitemap/newscategory.blade.php
Normal file
21
resources/views/sitemap/newscategory.blade.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
@if (count($categories) > 0)
|
||||
@foreach ($categories as $category)
|
||||
@if ($category->parent_id != null)
|
||||
@php
|
||||
$categoryparent = App\Models\Category::where('id', $category->parent_id)->first();
|
||||
@endphp
|
||||
<url>
|
||||
<loc>{{ url('category/' . $categoryparent->slug . '/' . $category->slug).'/' }}</loc>
|
||||
<lastmod>{{ $category->updated_at->setTimezone('Asia/Tehran')->toAtomString() }}</lastmod>
|
||||
</url>
|
||||
@endif
|
||||
@if ($category->parent == 1)
|
||||
<url>
|
||||
<loc>{{ url('category/' . $category->slug).'/' }}</loc>
|
||||
<lastmod>{{ $category->updated_at->setTimezone('Asia/Tehran')->toAtomString() }}</lastmod>
|
||||
</url>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</urlset>
|
||||
Reference in New Issue
Block a user