【发布时间】:2015-02-19 14:18:37
【问题描述】:
将此添加到 BaseController.php:
public function __construct() {
// Run the 'csrf' filter on all post, put, patch and delete requests.
$this->beforeFilter('csrf', ['on' => ['post', 'put', 'patch', 'delete']]);
}
或将其添加到 routes.php:
Route::when('*', 'csrf', array('post', 'put', 'patch', 'delete'));
哪种方法更好,为什么?
【问题讨论】: