Whenever I try to run any database-related Artisan command (e.g. migrate
, schema:dump
), I get an Array to string conversion
error:
❯ php artisan migrate
ErrorException
Array to string conversion
at vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php:41
37▕ * @return bool
38▕ */
39▕ public function hasTable($table)
40▕ {
➜ 41▕ $table = $this->connection->getTablePrefix().$table;
42▕
43▕ return count($this->connection->select(
44▕ $this->grammar->compileTableExists(), [$this->connection->getDatabaseName(), $table]
45▕ )) > 0;
+20 vendor frames
21 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
This seems to come from $connection->tablePrefix
being concatenated with various strings, which would mean that, although it's annotated as a string
, it's actually being assigned an array
at some point. As far as I know, I didn't change anything related to table prefixes (I didn't even know that that was a thing) from the default Laravel Breeze template.
My project is at https://github.com/aleksrutins/harknology.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community