# How do I inspect hook variables?

**URL:** <https://forum.getkirby.com/t/how-do-i-inspect-hook-variables/17733>\
**Category:** Questions\
**Tags:** v3\
**Created:** [March 30, 2020, 12:49pm UTC](https://forum.getkirby.com/t/how-do-i-inspect-hook-variables/17733 "2020-03-30T12:49:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marsupial](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marsupial](https://forum.getkirby.com/u/marsupial)\
**Post date:** [March 30, 2020, 12:49pm UTC](https://forum.getkirby.com/t/how-do-i-inspect-hook-variables/17733/1 "2020-03-30T12:49:52Z")

</div>

Hey everyone!  
I’m currently working on a user permission system for a magazine, which has three relevant user roles: author, editor and lead editor.  
I would like to limit the user permissions of the editors, that they can only create authors and not editors or lead editors. Something like this:

```
'hooks' => [
   'user.create:before' => function ($input) {
      if ($this->user()->role() == 'editor') {
        if ($input->role() !== 'author') {
         throw new Exception('Sorry! Du kannst nur Autor*innen erstellen.');
        }
      }
   },

```

So I tried it with the user.create:before hook, but whenever I want to use or inspect the $input variable inside of the hook with dump(), var\_dump() or print\_r() I get the following error message:

e.g.: `dump($input)`

 ![kirby error](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/1/15876675d094245984f7daa41a4be5c56a0ad90d.jpeg)

Is there something obvious I’m not aware of or do I have to do it in a different way?

Kirby Version: 3.3.5  
PHP: 7.4.1

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ahmetbora](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/ahmetbora/32/11671_2.png) [@ahmetbora](https://forum.getkirby.com/u/ahmetbora)\
**Post date:** [March 30, 2020, 12:57pm UTC](https://forum.getkirby.com/t/how-do-i-inspect-hook-variables/17733/2 "2020-03-30T12:57:19Z")

</div>

You can view dump details from console network tab.

---

<div class="post-metadata">

**Author:** ![marsupial](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marsupial](https://forum.getkirby.com/u/marsupial)\
**Post date:** [March 30, 2020, 1:09pm UTC](https://forum.getkirby.com/t/how-do-i-inspect-hook-variables/17733/3 "2020-03-30T13:09:09Z")

</div>

Thanks for your replay!

~~I only get the error messages:  
500 (Internal Server Error)  
Error: The JSON response from the API could not be parsed. Please check your API connection.~~

Not the usual dump message 🙁

Found the object, hidden in the 500 error, in the network tab, thank you!
