How do I implement hook_views_post_execute
My guess is you did not include the use statement at the top of your file that tells the application how to locate the class ViewExecutable. This is a PHP construct and not Drupal specific, which is why it is not always mentioned explicitly in the documentation.

At the top of your file, add:

use Drupal\views\ViewExecutable;

The incoming argument to the hook is of type ViewExecutable, but PHP does not know how to find that class, so it errors out unless you either use the use statement, or change the function signature to:

function idm_views_post_execute(Drupal\views\ViewExecutable $view)


Clear cache and reload. If the error persists, you'll need to provide log(s) to indicate what the actual error that occurred was.

If you copied and pasted the code here for hook_entity_view that would explain why that worked for you:

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21entity.api.php/function/hook_entity_view/8.6.x

The example here has the full path in the argument list.

hook_entity_view(array &amp;$build, \Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, $view_mode)