Answer the question
In order to leave comments, you need to log in
Laravel. Creating a form with CSRF?
Help me please. I am registering. Created a UserController controller which has functions for resource index, create, update, store.
To register users, I decided to use the store.
Created a page with a form:
<?php echo "\n"; echo Form::open(array('url' => 'user')); echo Form::token(); echo "\n"; ?>
.....
<?php echo Form::close(); echo "\n"; ?>
Next, I created a Route://Route::resource('user', 'UserController', array('only' => array('index','show','update')));
Route::post('user/store', array('before' => 'csrf'), function () {});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question