⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.10
Server IP:
15.204.235.159
Server:
Linux srv.techlup.co.ke 4.18.0-553.5.1.el8_10.x86_64 #1 SMP Wed Jun 5 09:12:13 EDT 2024 x86_64
Server Software:
Apache
PHP Version:
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
tech
/
www
/
script
/
app
/
Console
/
Commands
/
Edit File: SitemapUpdate.php
<?php namespace App\Console\Commands; use Illuminate\Console\Command; use App\Post; use App\Page; use App\Category; use samdark\sitemap\Sitemap; use samdark\sitemap\Index; class SitemapUpdate extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'daily:update-sitemap'; /** * The console command description. * * @var string */ protected $description = 'sitemap will genarate every 1 day'; /** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { $index = new Index(base_path('sitemap.xml')); $url=url('/'); foreach (Post::get() as $post) { $url=url('/').'/post/'.$post->slug; $index->addSitemap($url,time(), Sitemap::DAILY, 0.3); } foreach (Page::get() as $page) { $url=url('/').'/page/'.$page->slug; $index->addSitemap($url,time(), Sitemap::DAILY, 0.3); } $url=url('/').'/prevention'; $url=url('/').'/faq'; $url=url('/').'/blog'; $url=url('/').'/post'; $url=url('/').'/about'; $url=url('/').'/contact-us'; $index->write(); } }
Simpan