refactor ClientProgramController; replace caching logic with action classes for educational program retrieval and enhance code clarity
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Containers\Education\Tasks;
|
||||
|
||||
use App\Ship\Contracts\SeoServiceInterface;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class GetSeoForCurrentPageTask
|
||||
{
|
||||
public function run(SeoServiceInterface $seoPageProvider)
|
||||
{
|
||||
$cacheKeySeo = 'education_programs_seo';
|
||||
return Cache::remember($cacheKeySeo, now()->addDay(), function () use ($seoPageProvider) {
|
||||
return $seoPageProvider->getSeoForCurrentPage();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user