refresh cache button plugin : add last cache update date and time on button title

This commit is contained in:
isUnknown 2025-09-24 09:13:04 +02:00
parent a1f0701630
commit b1f7854510
5 changed files with 37 additions and 17 deletions

View file

@ -12,6 +12,11 @@ return [
$projects = page('projects')->children();
foreach ($projects as $project) {
$project->rebuildStepsCache();
$formatter = new IntlDateFormatter('fr_FR', IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, 'Europe/Paris');
$project->update([
'lastCacheUpdate' => $formatter->format(time())
]);
}
return [
'satus' => 'success',
@ -43,6 +48,12 @@ return [
$project->rebuildStepsCache();
$formatter = new IntlDateFormatter('fr_FR', IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, 'Europe/Paris');
$project->update([
'lastCacheUpdate' => $formatter->format(time())
]);
return [
'satus' => 'success',
'message' => 'Données de la page ' . $data->pageUri . ' rafraîchie avec succès.'