What would be the proper way of doing it?
I am doing this and it’s working:
// hook within a plugin
'hooks' => [
'page.update:after' => function ( $page ) {
if( $page->last_updated()->exists() ){
$page->update([
'last_updated' => date( 'Y-m-d H:i' )
]);
}
}
]
Is that all, or is there something missing?