How to create a label element for your form – Laravel

The <label> element is used to define a label for a specific <input> element. To create a label element in laravel use the following code.

See Also: Opening a Form in Laravel

{{ Form::label('email', 'E-Mail Address') }}

The above code will generate following HTML output,

<label for="email">E-Mail Address</label>

You can also specify additional HTML attributes by passing second parameter as an associative array,

{{ Form::label('email', 'E-Mail Address', array('class' => 'someCssClass')) }}

This will produce.

<label for="name" class="someCssClass">E-Mail Address</label>



Leave a Comment.