Laravel provides an easy method of protecting your application from cross-site request forgeries. First, a random token is placed in your user's session. Don't sweat it, this is done automatically. Next, use the token method to generate a hidden form input field containing the random token on your form:
#### Generating a hidden field containing the session's CSRF token:
> **Note:** After creating a label, any form element you create with a name matching the label name will automatically receive an ID matching the label name as well.
<a name="text"></a>
## Text, Text Area, Password & Hidden Fields
#### Generate a text input element:
echo Form::text('username');
#### Specifying a default value for a text input element:
echo Form::text('email', 'example@gmail.com');
> **Note:** The *hidden* and *textarea* methods have the same signature as the *text* method. You just learned three methods for the price of one!
#### Generating a password input element:
echo Form::password('password');
<a name="checkboxes-and-radio-buttons"></a>
## Checkboxes and Radio Buttons
#### Generating a checkbox input element:
echo Form::checkbox('name', 'value');
#### Generating a checkbox that is checked by default:
echo Form::checkbox('name', 'value', true);
> **Note:** The *radio* method has the same signature as the *checkbox* method. Two for one!
> **Note:** Need to create a button element? Try the *button* method. It has the same signature as *submit*.
<a name="custom-macros"></a>
## Custom Macros
It's easy to define your own custom Form class helpers called "macros". Here's how it works. First, simply register the macro with a given name and a Closure: