rcrowe / TwigBridge

Give the power of Twig to Laravel
MIT License
894 stars 167 forks source link

Cannot use Form Extension in Laravel 5.3 #303

Open maximeberard opened 7 years ago

maximeberard commented 7 years ago

I got a problem using Form Extension in Laravel 5.3. The extension is enabled in config/twigbridge.phpfile. I uncommented the line for form Extension.

At first i had a problem of missing dependency with laravelcollective/html FormBuilder so i added the dependency in my composer.jsonfile.

But i have now a new issue using this form extension in my template, which is : Cannot instantiate Twig extension 'TwigBridge\Extension\Laravel\Form': Unresolvable dependency resolving [Parameter #3 [ <required> $csrfToken ]] in class Collective\Html\FormBuilder

Is there any way to use properly this extension in Laravel 5.3 please?

gigo6000 commented 7 years ago

I'm having the same issue, the README says that this extension is enabled by default (with some others) but is actually commented out in config/twigbridge.php

aik099 commented 7 years ago

It's commented out, because classes it uses are no longer shipped with Laravel and were moved out into https://github.com/illuminate/html. You need to require illuminate/html package in your composer.json and then enabling these form providers would work.