kristijanhusak / laravel-form-builder

Laravel Form builder for version 5+!
https://packagist.org/packages/kris/laravel-form-builder
MIT License
1.7k stars 298 forks source link

Csrf_token is not generated in Laravel 5.4 #352

Open debeniter86 opened 7 years ago

debeniter86 commented 7 years ago

Hi,

I am trying to integrate form builder in Laravel 5.4. But am getting error. TokenMismatchException

felipeschmitz commented 7 years ago

I have the same problem. :(

kristijanhusak commented 7 years ago

Did you add a middleware for csrf token, like in this example? https://laravel.com/docs/5.4/middleware#middleware-groups

debeniter86 commented 7 years ago

Yeah, below is my middleware

protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            // \Illuminate\Session\Middleware\AuthenticateSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

        'api' => [
            'throttle:60,1',
            'bindings',
        ],
    ];
RoyRSO commented 7 years ago

Same problem here, checked my middleware but they seem alright.

debeniter86 commented 7 years ago

@kristijanhusak am waiting your response. Did you find what is the issue?

kristijanhusak commented 7 years ago

@debeniter86 @royreuversgit I am not able to reproduce it on v5.4.23. Can you give some more info? What exact version are you using? How did you set everything up? At what point you get that exception?

debeniter86 commented 7 years ago

@kristijanhusak I am using Laravel 5.4.23. Just trying to create simple form based on your documentation. while am calling form instant on blade file am getting TokenMismatchException exception.

kristijanhusak commented 7 years ago

@debeniter86 can you try it on fresh application to see if it happens? If yes, please tell me how to reproduce.