// Registering a hook HookRegistry::register('before_save', function($data){ // Do something before saving data }); // Triggering a hook HookRegistry::trigger('before_save', $data); // Removing a hook HookRegistry::remove('before_save');In the first example, we registered a hook called "before_save" that will execute a function before saving data. In the second example, we triggered the hook and passed the data variable to it. And in the third example, we removed the hook from the registry. Overall, HookRegistry is a useful package library for developers who need to register and manage hooks in their PHP applications.