mongodb/laravel-mongodb

Bug : (Exception: Method MongoDB\Laravel\Schema\Grammar::compileColumns does not exist.)

Closed this issue · 6 comments

  • Laravel-mongodb Version: 4.4.1
  • PHP Version: 8.3.8
  • Laravel Version: 10.48.12

Description:

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

Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead

Logs: Insert log.txt here (if necessary)

Could you create a small project that reproduces the issue? I tried the command from barryvdh/laravel-ide-helper and it seems to work correctly.

@GromNaN
I create a small project as per your request, but it reproduces the issue.
so I asked "laravel-ide-helper" about this issue.

Can you share this project with me please so that I can work on a fix.

Can you share this project with me please so that I can work on a fix.
This works
php artisan ide-helper:generate

Not working hence the error he/she shared above
php artisan ide-helper:models
image

@GromNaN please add these in, it also being used in laravel filament
https://filamentphp.com/docs/3.x/panels/resources/getting-started#automatically-generating-forms-and-tables

php artisan make:filament-resource Customer --generate

The method Schema\Builder::getColumns have been implemented in #3045 (release today).