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

Exception: Method MongoDB\Laravel\Schema\Grammar::compileColumns does not exist. #1562

Closed
Kim-Munbeom opened this issue Jun 18, 2024 · 1 comment
Labels

Comments

@Kim-Munbeom
Copy link

Versions:

  • ide-helper Version: 3.0.0
  • Laravel Version: 10.48.12
  • PHP Version: 8.3.8
  • Laravel-mongodb Version: 4.4.1

Description:

The "mongodb/laravel-mongodb" package says that the issue is not a problem.

When executing the "command(php artisan ide-helper:models -R)", the following error occurs.
If you look for the associated method, it doesn't exist.
Please resolve this error.

Exception: Method MongoDB\Laravel\Schema\Grammar::compileColumns does not exist.
Could not analyze class App\Models\B2bPay.

Trace:
#0 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(364): Illuminate\Database\Grammar->__call('compileColumns', Array)
#1 /path/to/laravel/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(499): Illuminate\Database\Schema\Builder->getColumns('b2b-pay')
#2 /path/to/laravel/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(283): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->getPropertiesFromTable(Object(App\Models\B2bPay))
#3 /path/to/laravel/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(176): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->generateDocs(Array, Array)
#4 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->handle()
#5 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#6 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#7 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#8 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#9 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call(Array)
#10 /path/to/laravel/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#11 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#12 /path/to/laravel/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /path/to/laravel/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Barryvdh\LaravelIdeHelper\Console\ModelsCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /path/to/laravel/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /path/to/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /path/to/laravel/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 {main}

Steps To Reproduce:

  1. php artisan ide-helper:models -R
  2. error occurred
@mfn
Copy link
Collaborator

mfn commented Jun 18, 2024

ide-helper needs to "inspect the database" to derive the columns, that's why we have to call ->getColumns() on the schema.

If the schema does not support this, there's not much we can do: that's a pretty integral part of everything here.

@mfn mfn closed this as completed Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants