Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

foreach() argument must be of type array|object, null given #287

Open
yowgerald opened this issue Jun 19, 2024 · 0 comments
Open

foreach() argument must be of type array|object, null given #287

yowgerald opened this issue Jun 19, 2024 · 0 comments

Comments

@yowgerald
Copy link

yowgerald commented Jun 19, 2024

I encountered an error while using MySQL as the database in a Docker container. Below are the details of my composer.json file:

  • "reliese/laravel": "^1.3"
  • "laravel/framework": "^11.10.0",
  • "php": ">=8.3",
root@a22dd90f1c16:/var/www/html# php artisan code:models --table=table_xxx

   ErrorException 

  foreach() argument must be of type array|object, null given

  at vendor/reliese/laravel/src/Meta/MySql/Schema.php:106
    102▕      */
    103▕     protected function fillColumns(Blueprint $blueprint)
    104▕     {
    105▕         $rows = $this->arraify($this->connection->select('SHOW FULL COLUMNS FROM '.$this->wrap($blueprint->qualifiedTable())));
  ➜ 106▕         foreach ($rows as $column) {
    107▕             $blueprint->withColumn(
    108▕                 $this->parseColumn($column)
    109▕             );
    110▕         }

      +24 vendor frames 

  25  artisan:12
      Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))
      

Could you please help me identify and resolve the issue? Any guidance or suggestions would be greatly appreciated.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant