Level 52
Check your PHP version.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm getting this error on my prod server when I call a method that uses belongsToMany():
FatalErrorException in Model.php line 936:
Class name must be a valid object or a string
in Model.php line 936
What I find strange is that the same code, shows no error on my local dev vagrant (both run on Debian, php 5.6.11, uses Laravel 5.1 and the same LAMP stack).
Is this could be related to some kind of php conf directive ?
Please or to participate in this conversation.