How to create a password field in Laravel

In one of the previous posts, we have already created a text input field in Laravel. In this post, we are going to create a password input field with the help of Laravel Form and HTML builder package.

Quick Tip : How to get a random record from a table in Laravel?

To create a password field in Laravel template use the following code.

{{ Form::password('pass') }}

This will produce following output,

<input name="pass" type="password" value="">

To add additional HTML attributes pass second parameter as an associative array.

{{ Form::password('pass', array('class' => 'myClass')) }}

This will generate following output,

<input class="myClass" name="pass" type="password" value="">



Leave a Comment.