İlk temizlik tamamlandı bir önceki projeden
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user