Files
citrus-cms/app/Console/Commands/SummaryCalculation.php
T
2026-04-28 21:14:25 +03:00

60 lines
1.4 KiB
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class SummaryCalculation extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'summary:calculation';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Dispatch blade view caching for summary calculation';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$this->info('Starting summary calculation cache dispatch...');
$cacheViews = [
[
'view' => 'admin.type.summary-nocache',
'cache' => 'summary-dashboard'
],
[
'view' => 'admin.dashboard.module.dashboard',
'cache' => 'dashboard'
],
[
'view' => 'admin-ajax.ndt-calculation-no-cache',
'cache' => 'ndt-calculation'
],
];
if (function_exists('dispatchCacheBladeViews')) {
dispatchCacheBladeViews($cacheViews);
$this->info('Dispatched cache jobs successfully.');
} else {
$this->error('Helper function dispatchCacheBladeViews not found.');
return 1;
}
return 0;
}
}