?
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Cmsblock;
use App\Models\Blog;
class SitemapController extends Controller
{
//pages
public static function getPageXML(){
$dataviewer = Cmsblock::WHERE('currentstatus','0')
->with('getNavigationTitle')
->orderBy('categoryid', 'DESC')
->orderBy('id', 'DESC')
->get();
return response()->view('xml.page-sitemap', [
'items' => $dataviewer
])->header('Content-Type', 'text/xml');
}
//blog post
public static function getPostXML(){
$dataviewer = Blog::where('currentstatus', '0')
->whereNotNull('slug')
->orderBy('id', 'DESC')
->get();
return response()->view('xml.post-sitemap', [
'items' => $dataviewer
])->header('Content-Type', 'text/xml');
}
public static function getindexXML(){
$cmsblockPages = 1;
$blogPages = 1;
return response()->view('xml.index', [
'cmsblockPages' => $cmsblockPages,
'blogPages' => $blogPages
])->header('Content-Type', 'text/xml');
}
//testimonials
// public static function getProductXML(){
// $Product = Product::Select('productid','productname','slug')->Where('CurrentStatus','0')
// ->get() ;
// return response()->view('xml.product-sitemap', [
// 'items' => $Product
// ])->header('Content-Type', 'text/xml');
// }
}