designtopack/public/site/config/hooks/file-update--regenerate-project-steps-cache.php
isUnknown 2791bc4462 Ajout invalidation cache notifications dans hook file-update
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 11:42:40 +01:00

11 lines
No EOL
398 B
PHP

<?php
// file.update:after
return function ($newFile, $oldFile) {
$project = $newFile->parent()->template() == 'project' ? $newFile->parent() : $newFile->parent()->parents()->findBy('template', 'project');
if ($project) {
$project->rebuildStepsCache();
// Invalider aussi le cache des notifications (commentaires sur fichiers, etc.)
$project->invalidateNotificationsCache();
}
};