TwigBridge: Getting `Unresolvable dependency` exception
I’m using https://github.com/barryvdh/laravel-ide-helper to generate auto-complete for PhpStorm. I guess it’s invoking all services providers to work. As a result I’m getting following exception:
Exception: Cannot instantiate Twig extension 'TwigBridge\Extension\Laravel\Form': Unresolvable dependency resolving [Parameter #2 [ <required> $csrfToken ]] in class Illuminate\Html\FormBuilder
Skipping \TwigBridge\Facade\Twig.
A new helper file was written to _ide_helper.php
I guess this happens because the mentioned TwigBridge\Extension\Laravel\Form class has dependency on FormBuilder (see https://github.com/rcrowe/TwigBridge/blob/master/src/Extension/Laravel/Form.php#L34), which happens to have 3rd required argument called $csrfToken: https://github.com/laravel/framework/blob/4.2/src/Illuminate/Html/FormBuilder.php#L82
Used Laravel Version: 4.3
Related issue: barryvdh/laravel-ide-helper#119
About this issue
- Original URL
- State: open
- Created 10 years ago
- Comments: 46 (25 by maintainers)
Commits related to this issue
- Merge pull request #12 from aik099/register-container-aliases-fix Creating missing container aliases from "registerCoreContainerAliases" method — committed to illuminate/html by taylorotwell 10 years ago
@enchance the fix was to add a app/Providers/FormServiceProvider.php with the following content: