MahmoudAdelAli's avatar

Laravel IDE helper not work correctly

hello , i have install laravel IDE with laravel plugin to php storm and it's work correctly , but when i use it in the another project it never work even i do every step in the last project and following the document

composer require --dev barryvdh/laravel-ide-helper

and

Add Laravel IDE helper as a ServiceProvider into the application. In the config/app.php file, add Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class under the providers element:

return array(
    // ...
    'providers' => array(
        // ...
        // Laravel IDE helper
        'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class',
    ),
    // ...
);

also

public function register()
{
    if ($this->app->isLocal()) {
        $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
    }
    // ...
}
0 likes
2 replies
thinkverse's avatar
Level 15

You don't need to add the service provider into your config unless you want ide-helper to be loaded in production, and I personally cannot see a reason for why it should be.

Just requiring the package is enough for it to work since it uses Laravel's auto-discovery system. It even states as much in the README.

This package makes use of Laravels package auto-discovery mechanism, which means if you don't install dev dependencies in production, it also won't be loaded.

After requiring it you should have access to the three new commands shown in the usage.

php artisan ide-helper:generate
php artisan ide-helper:models
php artisan ide-helper:meta
MahmoudAdelAli's avatar

@thinkverse i do all that commands , and when i replay on your comment i found the problem from github discussion , and the problem is the route name space for the laravel plugin

Please or to participate in this conversation.