2
@can('user-delete')
    {!! Form::open(['method' => 'DELETE','route' => ['users.destroy', $user->id],'style'=>'display:inline']) !!}
    {!! Form::submit('Delete', ['class' => 'btn btn-default']) !!}
    {!! Form::close() !!}
@endcan 

I need to display fa icon instead of DELETE text in the button,

<i class="fas fa-trash-alt"></i>

How can I display this fa icon in that button.

I'm using laravel and bootstrap 4.

Remul
  • 7,874
  • 1
  • 13
  • 30
Volka Dimitrev
  • 337
  • 4
  • 15
  • 38

2 Answers2

1

Use the Form::button instead of Form::submit to achieve this:

{{ Form::button('<i class="fas fa-trash-alt"></i>', ['class' => 'btn btn-default', 'type' => 'submit']) }}

Then you can simply add the type to submit to the button instance.

Nathan
  • 1,162
  • 1
  • 9
  • 14
0

You can use something like this:

<div class="input-group margin-bottom-sm">
    <span class="input-group-addon"><i class="fa fa-trash-alt"></i></span>
    {!! Form::button('name if you need', array('class' => 'form-control') ) !!}
</div>

into your Form::button array you can use everything you need such as 'type'=>'submit'

Mohammad Hosseini
  • 1,649
  • 1
  • 16
  • 31