LARAVEL style password box with bootstrap

in this form I heve Form::password(), and for this I can not create a class. for example, this class and style for Form::textmay work correctly.

{{ Form::text('username', Input::old('username'), array('placeholder'=>'UserName', 'class'=>'form-control' ) ) }}

Generated HTML:

<input id="username" class="form-control" type="text" name="username" placeholder="username">

but for Form::password()do not work:

{{ Form::password('password', null, array('placeholder'=>'Password', 'class'=>'form-control' ) ) }}

Generated HTML:

<input id="password" type="password" value="" name="password">
+4
source share
2 answers

This will work:

{{ Form::password('password', array('placeholder'=>'Password', 'class'=>'form-control' ) ) }}

You do not need a null value, since you cannot specify a default value for password fields.

+23
source

You can also use your own HTML macro, which allows syntax similar to your first example.

See my answer here: How to pass a value in the Password field in Laravel

0

Source: https://habr.com/ru/post/1529562/


All Articles