Files
citrus-cms/resources/views/cron/cache-blade-dashboard.blade.php
2026-04-28 21:15:09 +03:00

36 lines
1.0 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// Dashboard View Cache Generator
// Bu cron görevi, dashboard blade viewını önbelleğe alır ve storage/app/cache/ dizinine kaydeder
use Illuminate\Support\Facades\Storage;
// Cache klasörünü oluştur (yoksa)
if (!Storage::exists('cache')) {
Storage::makeDirectory('cache');
}
// Önbelleğe alınacak view
$viewPath = 'admin.dashboard.module.dashboard';
$cacheFileName = 'dashboard';
try {
// View içeriğini oluştur
$viewContent = view($viewPath)->render();
// Cache dosyasını kaydet
Storage::put("cache/{$cacheFileName}.blade.php", $viewContent);
// Son güncelleme zamanını kaydet
Storage::put("cache/{$cacheFileName}_last_updated.txt", date('Y-m-d H:i:s'));
echo "{$viewPath} önbelleği başarıyla güncellendi: " . date('Y-m-d H:i:s') . "<br>";
Artisan::call('cache:clear');
Artisan::call('config:clear');
Artisan::call('view:clear');
} catch (\Exception $e) {
echo "{$viewPath} önbelleği güncellenirken hata oluştu: " . $e->getMessage() . "<br>";
}
?>