I saw what I did wrong, I was using $that ($that was fetched from an parameter in the function) instead of $this in my plugin(plugins/content.php code) because I did not know how I could include the dependency Injector into my class but after that I did know, just by extending it with Phalcon\Mvc\User\Component.

Do you still want me to upload my code?

I also found out that $model->create(); will also trigger an 500 error if an foreign key constraint fails.

I saw what I did wrong, I was using $that ($that was fetched from an parameter in the function) instead of $this in my plugin(plugins/content.php code) because I did not know how I could include the dependency Injector into my class but after that I did know, just by extending it with Phalcon\Mvc\User\Component.

Do you still want me to upload my code?

I also found out that $model->create(); will also trigger an 500 error if an foreign key constraint fails.