formers / former

A powerful form builder, for Laravel and other frameworks (stand-alone too)
https://formers.github.io/former/
1.34k stars 205 forks source link

Update Elements.php #536

Closed kilrizzy closed 7 years ago

kilrizzy commented 7 years ago

Laravel 5.4 removed session->getToken() in place of session->token()

(However I'm not sure if this would be compatible with older laravel versions and may need a new branch/version)

tortuetorche commented 7 years ago

Hi @kilrizzy,

Maybe you can keep backward compatibility, with something like this (:warning: untested) :

$csrf = method_exists($this->session, 'getToken') ? $this->session->getToken() : $this->session->token();

Cheers, Tortue Torche

claar commented 7 years ago

We ended up using tortuetorche's code above.