Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialEdmunds Sulzanoks
6,298 PointsbeforeFilter accepts modified tokens
did everything as in vid, but when i modify my token, it doesn't generate error.
<?php
public function _construct()
{
$this->beforeFilter('csrf', array('on' => 'post'));
}
2 Answers
Edmunds Sulzanoks
6,298 PointsFont / video quality made it hard to read that there had to be 2 undesrscores before 'construct'. That was my problem
thomascawthorn
22,986 PointsTry and test in the routes file too e.g.:
<?php
Route::post('register', array('before' => 'csrf', function()
{
return 'You gave a valid CSRF token!';
}));
also be sure to take a look at your csrf filter in the filters folder!