两者之间有真正的区别吗 csrf_token()
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
和Session::token()
?
<input type="hidden" name="_token" value="{{ Session::token() }}" />
他们似乎都产生了相同的结果。
Laravel提供了多种不同的方法来执行相同的任务。
第一个示例是帮助程序功能:https : //laravel.com/docs/5.1/helpers
第二个示例是会话外观:https://laravel.com/docs/5.1/facades
结果没有差异,因为它们最后都将调用相同的方法。他们正在调用的实际方法是:https : //laravel.com/api/5.1/Illuminate/Session/Store.html#method_token
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句