HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //var/www/quadcode-jobs/app/Http/Controllers/SitemapController.php
<?php

namespace App\Http\Controllers;

use App\Models\LeverCategory;
use App\Models\Location;
use App\Repositories\CategoryRepository;
use App\Repositories\OfficeRepository;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\URL;
use Laravelium\Sitemap\Sitemap;

class SitemapController extends BaseController
{

    public function sitemap(Sitemap $sitemap): Response
    {
        $sitemap->setCache('quadcode.sitemap', 60);
        if ($sitemap->isCached()) {
            return $sitemap->render();
        }

        $sitemap->add(URL::route('home'));
        $sitemap->add(URL::route('jobs'));
        $sitemap->add(URL::route('offices'));

        $categories = CategoryRepository::getCategories();
        foreach ($categories as $category) {
            /** @var LeverCategory $category */
            $sitemap->add(URL::route('category.show', [$category->id]));
        }

        $offices = OfficeRepository::getOffices();
        foreach ($offices as $office) {
            /** @var Location $office */
            $sitemap->add(URL::route('office', [strtolower($office->title)]));
        }

        $sitemap->add(URL::route('privacy-policy'));
        $sitemap->add(URL::route('term-and-conditions'));
        $sitemap->add(URL::route('cookie-policy'));
        $sitemap->add(URL::route('products-and-stack'));
        $sitemap->add(URL::route('quadcode-life'));

        return $sitemap->render();
    }

}