HI
Did you check your .env file?
You should have something like this:
APP_ENV=local APP_DEBUG=true
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've worked on building a website, but for some reason, Laravel isn't giving me usual errors with the gray background if something goes wrong, instead now I get a HTTP 500 server error.
When I'm looking into the server's error logs, here's what I get:
PHP Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to undefined method Illuminate\Database\Query\Builder::error()' in C:\wamp\www\blog\vendor\laravel\framework\src\Illuminate\Database\Query\Builder.php:2445
Stack trace:
#0 C:\wamp\www\blog\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php(1245): Illuminate\Database\Query\Builder->__call('error', Array)
#1 C:\wamp\www\blog\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php(1245): Illuminate\Database\Query\Builder->error(Object(Symfony\Component\Debug\Exception\FatalErrorException))
#2 C:\wamp\www\blog\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(1329): Illuminate\Database\Eloquent\Builder->__call('error', Array)
#3 C:\wamp\www\blog\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(1329): Illuminate\Database\Eloquent\Builder->error(Object(Symfony\Component\Debug\Exception\FatalErrorException))
#4 C:\wamp\www\blog\vendor\laravel\framework\src\Illuminate\Foundation\Excepti in C:\wamp\www\blog\vendor\laravel\framework\src\Illuminate\Database\Query\Builder.php on line 2445
Anyone has any idea what could this be? Because I haven't modified anything really. I'm using Laravel's 5.4 version.
I've been trying to search for a workaround/disabling some functions in the query builder but no luck - been doing this for the past 7 hours...
Any help would be greatly appreciated!
Cheers!
MORE INFORMATION: http://stackoverflow.com/questions/42959666/php-fatal-error-500-instead-of-usual-errors-in-laravel-5-4
Please or to participate in this conversation.