8

In html I can use <span> tag inside form label like this:

<label for="name" class="class-name">Name:<span class="required"></span></label>

Using Laravel Blade, the code for label is like this:

{!! Form::label('name','Name:',['class'=>'class-name']) !!}

How can I use <span> inside form label using blade template?

smartrahat
  • 4,455
  • 5
  • 39
  • 62

2 Answers2

9

Try this one code:

{!! Html::decode(Form::label('name','Name: <span class="required"></span>')) !!}
Ján Ambroz
  • 168
  • 8
8

Just set the 4th parameter of Form::label to false which is escape_html = false.

{!! Form::label('name','Name: <span class="required"></span>', [], false) !!}
Alex
  • 27,292
  • 13
  • 89
  • 143