EscolaLMS/Courses

View on GitHub
src/Services/CacheGetRequestService.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace EscolaLms\Courses\Services;

use Illuminate\Http\Request;
use Spatie\ResponseCache\CacheProfiles\CacheAllSuccessfulGetRequests;

class CacheGetRequestService extends CacheAllSuccessfulGetRequests
{
    public function useCacheNameSuffix(Request $request): string
    {
        return isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] . '_' . parent::useCacheNameSuffix($request) : parent::useCacheNameSuffix($request);
    }
}