framework: Unexpected Error: Illuminate/Testing/Concerns/TestDatabases.php
Laravel Version: 8.25.0 Laravel Framework: 8.25.0
After composer update from laravel v8.24 to v8.25 it breaks and throws off things.

Error: syntax error, unexpected ')
Cause of the Issue:
protected function switchToDatabase($database)
{
DB::purge();
$default = config('database.default');
config()->set(
"database.connections.{$default}.database",
$database,
);
}
Temp solution to Fix: Commented the switchToDatabase function.
protected function switchToDatabase($database)
{
/* DB::purge();
$default = config('database.default');
config()->set(
"database.connections.{$default}.database",
$database,
);*/
}
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (5 by maintainers)
Could you please elaborate more about your solution?, what do you mean
reference to PHP7.2 for DELETE requests in the web.config file.UPDATE Nevermind, I found the issue, my apache wasn’t running php7.4 so I just removed the old version with
sudo a2dismod php7.2, enabled the new one withsudo a2enmod php7.4and finally restarted the apache servicesudo service apache2 restartjust remove the commas before " ) "
Okay, found the issue. The request was a DELETE request and there was a reference to PHP7.2 for DELETE requests in the web.config file. Sorry! Thanks!
Hello there, it seems you’re using running the page on PHP lower than 7.3. Otherwise, you shouldn’t be able to see this error.