Laravel-ide-helper: php artisan ide-helper:generate does not work properly for laravel 6.0

Created on 4 Sep 2019  路  8Comments  路  Source: barryvdh/laravel-ide-helper

php artisan ide-helper:generate

shows this error:

[   ReflectionException  : Method Monolog\Logger::addDebug() does not exist

  at /**/**/vendor/barryvdh/laravel-ide-helper/src/Alias.php:322
    318|             list($className, $name) = explode('::', $real);
    319|             if (!class_exists($className) && !interface_exists($className)) {
    320|                 continue;
    321|             }
  > 322|             $method = new \ReflectionMethod($className, $name);](url)

Most helpful comment

Can you remove your config and try again?

All 8 comments

+1
I get the same error

Can you remove your config and try again?

@barryvdh yep - this solved it for me! Looks like related to the changes in the commit 0edf8f750e0f5c774cbc8e8eab2e21eb3550f84f - removing the magic functions for Monolog.

Yeah maybe we should double check that.

What do you mean with remove the config?

I am new to laravel.

Thanks

EDIT:
To remove the config just type "php artisan config:cache". Found out how.

I get the same error

@K2ouMais, @djoudi - you'll have a config file for this package at config/ide-helper.php. You can try replacing the value of the the magic option at around line 101 with an empty array (e.g. 'magic' => [],.

Alternatively, if you haven't made any changes to other options in the config file, you can just delete the file, then re-create it by running php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config. This was the method I used.

Following that, as @K2ouMais mentioned, you may need to clear your config cache by running php artisan cache:clear.

I added a check for this, so the config doesn't need to be updated.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ivansammartino picture ivansammartino  路  3Comments

beniaminorossini picture beniaminorossini  路  5Comments

GitzJoey picture GitzJoey  路  4Comments

neeravp picture neeravp  路  3Comments

hatamiarash7 picture hatamiarash7  路  3Comments